Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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 8-Feb-13 2:00am
Tanumay991.7K
Edited 8-Feb-13 6:16am
v2

1 solution

Rate this: bad
good
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.

 
[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#
  Permalink  

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

  Print Answers RSS
0 Nirav Prabtani 339
1 OriginalGriff 309
2 _Amy 285
3 Sergey Alexandrovich Kryukov 200
4 Kumarbs 144
0 OriginalGriff 7,889
1 Sergey Alexandrovich Kryukov 7,006
2 Maciej Los 4,014
3 Peter Leow 3,708
4 CHill60 2,762


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 3 Jul 2013
Copyright © CodeProject, 1999-2014
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