Click here to Skip to main content
14,775,221 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
In Java I can easily set an annotation
as for example
@Entity
Class User
{
String name;
...//geter
...//seter
}

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
Updated 8-Feb-13 7:16am
v2

1 solution

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


[Table(name="TEmployee")]
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)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900