Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I am new to CodeFirst.
I wish to create a Table as follows:

SQL
Create Table [dbo].[UserAccount]
(
[UserID] int Identity(1,2),
[Email] nvarchar(50),
[UserName] nvarchar(50),
[Password]nvarchar(50),
Constraint [PkUserAccount] Primary Key([UserID]),
Constraint [UkEmail] Unique([Email]),
Constraint [UkUserName] Unique([UserName])
)
Go




How could I create such table using EF5 codefirst approach?
Posted

1 solution

 
Share this answer
 
v2
Comments
Member 10197079 17-Sep-13 7:39am    
I am asking for C# MVC Model Codefirst not in sql or other database managers:(
Dholakiya Ankit 17-Sep-13 7:45am    
you have selected asp.net as your criteria man

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