Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#4.0
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
Edited 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
0 Kornfeld Eliyahu Peter 430
1 OriginalGriff 304
2 Nelek 115
3 Sergey Alexandrovich Kryukov 99
4 Gihan Liyanage 99
0 Kornfeld Eliyahu Peter 420
1 OriginalGriff 140
2 Gihan Liyanage 99
3 Nelek 65
4 sankarsan parida 65

Advertise | Privacy | Mobile
Web04 | 2.8.140827.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