Click here to Skip to main content
13,558,244 members
Rate this:
Please Sign up or sign in to vote.
See more:
In Java I can easily set an annotation
as for example
Class User
String name;

Here @Entity is an annotation
I can be able to create a table name User and as User is set as @Entity annotation.

Similarly how can I able to set a c# class as Entity. Means How I make an @Entity annotation for a class?
kindly help me.
Also if any body know ,kindly tell me ,is there any annotation use for forward engineering in n-Hibernate?
Posted 8-Feb-13 2:00am
Updated 8-Feb-13 6:16am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

using System.Data.LINQ.Mapping;
Then we can map our class according to the table.

public class Employee
[Coloumn(IsPrimaryKey=true,Storage="ID", Name="_id")]
public int Id{get;set;}

Thus we can set annotation or set set our class property according to table field in c#

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01-2016 | 2.8.180515.1 | Last Updated 3 Jul 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100