Click here to Skip to main content
11,934,199 members (36,825 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# 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 3:00am
Edited 8-Feb-13 7: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 | Mobile
Web02 | 2.8.151126.1 | Last Updated 3 Jul 2013
Copyright © CodeProject, 1999-2015
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