Interfaces
This commit is contained in:
17
Domain/App.config
Normal file
17
Domain/App.config
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||
<parameters>
|
||||
<parameter value="mssqllocaldb" />
|
||||
</parameters>
|
||||
</defaultConnectionFactory>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
@@ -17,6 +17,6 @@ namespace Domain
|
||||
public int SubjectId { get; set; }
|
||||
public Subject Subject { get; set; }
|
||||
|
||||
public virtual List<Person> Persons { get; set; } = new List<Person>();
|
||||
public virtual List<PersonCources> Persons { get; set; } = new List<PersonCources>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,14 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -48,6 +56,10 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Subject.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -6,11 +6,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Domain.Enums
|
||||
{
|
||||
class PersonType
|
||||
public enum PersonType
|
||||
{
|
||||
public enum PersonTypeEnum {
|
||||
Student,
|
||||
Teacher
|
||||
}
|
||||
Student,
|
||||
Teacher
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Domain
|
||||
{
|
||||
@@ -20,7 +21,9 @@ namespace Domain
|
||||
[Required]
|
||||
public string LastName { get; set; }
|
||||
|
||||
public virtual List<Cource> Courses { get; set; }
|
||||
public PersonType PersonType { get; set; }
|
||||
|
||||
public virtual List<PersonCources> Courses { get; set; } = new List<PersonCources>();
|
||||
|
||||
#region NotMaped
|
||||
public string FirstLastName => $"{FirstName} {LastName}";
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Domain
|
||||
{
|
||||
class Subject
|
||||
public class Subject
|
||||
{
|
||||
public int SubjectId { get; set; }
|
||||
|
||||
|
||||
4
Domain/packages.config
Normal file
4
Domain/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.1.3" targetFramework="net452" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user