Compare commits

...

2 Commits

6 changed files with 127 additions and 81 deletions

View File

@ -31,25 +31,4 @@ namespace ProjectGrid.Data
return user; return user;
} }
} }
public class UserData
{
public int? Id { get; set; }
public string Name1 { get; set; }
public string Name2 { get; set; }
public string Email { get; set; }
public UserData() { }
public UserData(UserModel model)
{
Name1 = model.firstName;
Name2 = model.lastName;
Email = model.email;
}
public UserModel ToModel()
{
return new UserModel { firstName = Name1, lastName = Name2, email = Email };
}
}
} }

View File

@ -17,7 +17,7 @@ namespace ProjectGrid.Data
return; // DB has been seeded return; // DB has been seeded
} }
var users = new UserData[] /*var users = new UserData[]
{ {
new UserData{Name1="Carson",Name2="Alexander",Email="test@abc.com"}, new UserData{Name1="Carson",Name2="Alexander",Email="test@abc.com"},
new UserData{Name1="Meredith",Name2="Alonso",Email="test@abc.com"}, new UserData{Name1="Meredith",Name2="Alonso",Email="test@abc.com"},
@ -31,7 +31,7 @@ namespace ProjectGrid.Data
foreach (UserData s in users) foreach (UserData s in users)
{ {
context.Users.Add(s); context.Users.Add(s);
} }*/
context.SaveChanges(); context.SaveChanges();
} }

16
Data/MapData.cs Normal file
View File

@ -0,0 +1,16 @@
using ProjectGrid.Models;
namespace ProjectGrid.Data
{
public class MapData
{
public int? Id { get; set; }
public uint Width { get; set; }
public uint Height { get; set; }
public MapData() { }
}
}

26
Data/UserData.cs Normal file
View File

@ -0,0 +1,26 @@
using ProjectGrid.Models;
namespace ProjectGrid.Data
{
public class UserData
{
public int? Id { get; set; }
public string Name1 { get; set; }
public string Name2 { get; set; }
public string Email { get; set; }
public UserData() { }
public UserData(UserModel model)
{
Name1 = model.firstName;
Name2 = model.lastName;
Email = model.email;
}
public UserModel ToModel()
{
return new UserModel { firstName = Name1, lastName = Name2, email = Email };
}
}
}

25
ProjectGrid.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31025.194
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectGrid", "ProjectGrid.csproj", "{C35FFE8E-105A-4EFB-9FA8-E08C0EBDEE71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C35FFE8E-105A-4EFB-9FA8-E08C0EBDEE71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C35FFE8E-105A-4EFB-9FA8-E08C0EBDEE71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C35FFE8E-105A-4EFB-9FA8-E08C0EBDEE71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C35FFE8E-105A-4EFB-9FA8-E08C0EBDEE71}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1D55053-1465-4925-B898-8867FB608551}
EndGlobalSection
EndGlobal