-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Adexandria/feature/many-to-many-mapping
Fix/many to many mapping
- Loading branch information
Showing
18 changed files
with
351 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Automapify.Client.Models.Dtos | ||
{ | ||
public class TeacherDto | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Automapify.Client.Models.Dtos; | ||
|
||
namespace Automapify.Client.Models | ||
{ | ||
public class Teacher | ||
{ | ||
public Teacher() | ||
{ | ||
|
||
} | ||
public Teacher(string firstName, string lastName) | ||
{ | ||
FirstName = firstName; | ||
LastName = lastName; | ||
} | ||
|
||
public Teacher AssignClassroom(Classroom classroom) | ||
{ | ||
Classroom = classroom; | ||
return this; | ||
} | ||
|
||
public string FirstName { get; set; } | ||
public string LastName { get; set; } | ||
public Classroom Classroom { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
{ | ||
public class Course | ||
{ | ||
public Course() | ||
{ | ||
|
||
} | ||
public Course(string name, string courseCode) | ||
{ | ||
Id = 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
{ | ||
public class Lecturer | ||
{ | ||
public Lecturer() | ||
{ | ||
|
||
} | ||
public Lecturer(string name) | ||
{ | ||
Id = 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Automapify.Models | ||
{ | ||
public class Property | ||
{ | ||
public Property(string propertyName) | ||
{ | ||
PropertyName = propertyName; | ||
} | ||
|
||
public string SourceName { get; set; } | ||
public string PropertyName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Linq.Expressions; | ||
|
||
namespace Automapify.Services.Extensions | ||
{ | ||
public static class MappingExtension | ||
{ | ||
public static Expression<Func<TSource, SourceMember>> MapFrom<TSource, SourceMember>(this IEnumerable<TSource> source, Expression<Func<TSource, SourceMember>> sourcePredicate) | ||
{ | ||
return sourcePredicate; | ||
} | ||
|
||
public static Expression<Func<TSource,SourceMember>> MapTo<TSource, SourceMember>(this IEnumerable<TSource> destination, Expression<Func<TSource, SourceMember>> sourcePredicate) | ||
{ | ||
return sourcePredicate; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.