-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,169 changed files
with
70,003 additions
and
71,172 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
using FluentNHibernate.Conventions; | ||
using FluentNHibernate.Conventions.Instances; | ||
|
||
namespace Examples.FirstAutomappedProject | ||
namespace Examples.FirstAutomappedProject; | ||
|
||
/// <summary> | ||
/// This is a convention that will be applied to all entities in your application. What this particular | ||
/// convention does is to specify that many-to-one, one-to-many, and many-to-many relationships will all | ||
/// have their Cascade option set to All. | ||
/// </summary> | ||
class CascadeConvention : IReferenceConvention, IHasManyConvention, IHasManyToManyConvention | ||
{ | ||
/// <summary> | ||
/// This is a convention that will be applied to all entities in your application. What this particular | ||
/// convention does is to specify that many-to-one, one-to-many, and many-to-many relationships will all | ||
/// have their Cascade option set to All. | ||
/// </summary> | ||
class CascadeConvention : IReferenceConvention, IHasManyConvention, IHasManyToManyConvention | ||
public void Apply(IManyToOneInstance instance) | ||
{ | ||
public void Apply(IManyToOneInstance instance) | ||
{ | ||
instance.Cascade.All(); | ||
} | ||
instance.Cascade.All(); | ||
} | ||
|
||
public void Apply(IOneToManyCollectionInstance instance) | ||
{ | ||
instance.Cascade.All(); | ||
} | ||
public void Apply(IOneToManyCollectionInstance instance) | ||
{ | ||
instance.Cascade.All(); | ||
} | ||
|
||
public void Apply(IManyToManyCollectionInstance instance) | ||
{ | ||
instance.Cascade.All(); | ||
} | ||
public void Apply(IManyToManyCollectionInstance instance) | ||
{ | ||
instance.Cascade.All(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
namespace Examples.FirstAutomappedProject.Entities | ||
namespace Examples.FirstAutomappedProject.Entities; | ||
|
||
public class Employee | ||
{ | ||
public class Employee | ||
{ | ||
public virtual int Id { get; protected set; } | ||
public virtual string FirstName { get; set; } | ||
public virtual string LastName { get; set; } | ||
public virtual Store Store { get; set; } | ||
} | ||
} | ||
public virtual int Id { get; protected set; } | ||
public virtual string FirstName { get; set; } | ||
public virtual string LastName { get; set; } | ||
public virtual Store Store { 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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
namespace Examples.FirstAutomappedProject.Entities | ||
namespace Examples.FirstAutomappedProject.Entities; | ||
|
||
public class Location | ||
{ | ||
public class Location | ||
{ | ||
public virtual int Aisle { get; set; } | ||
public virtual int Shelf { get; set; } | ||
} | ||
} | ||
public virtual int Aisle { get; set; } | ||
public virtual int Shelf { 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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Examples.FirstAutomappedProject.Entities | ||
namespace Examples.FirstAutomappedProject.Entities; | ||
|
||
public class Product | ||
{ | ||
public class Product | ||
{ | ||
public virtual int Id { get; protected set; } | ||
public virtual string Name { get; set; } | ||
public virtual double Price { get; set; } | ||
public virtual Location Location { get; set; } | ||
public virtual IList<Store> StoresStockedIn { get; set; } | ||
public virtual int Id { get; protected set; } | ||
public virtual string Name { get; set; } | ||
public virtual double Price { get; set; } | ||
public virtual Location Location { get; set; } | ||
public virtual IList<Store> StoresStockedIn { get; set; } | ||
|
||
public Product() | ||
{ | ||
StoresStockedIn = new List<Store>(); | ||
} | ||
public Product() | ||
{ | ||
StoresStockedIn = new List<Store>(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,30 +1,29 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Examples.FirstAutomappedProject.Entities | ||
namespace Examples.FirstAutomappedProject.Entities; | ||
|
||
public class Store | ||
{ | ||
public class Store | ||
{ | ||
public virtual int Id { get; protected set; } | ||
public virtual string Name { get; set; } | ||
public virtual IList<Product> Products { get; set; } | ||
public virtual IList<Employee> Staff { get; set; } | ||
public virtual int Id { get; protected set; } | ||
public virtual string Name { get; set; } | ||
public virtual IList<Product> Products { get; set; } | ||
public virtual IList<Employee> Staff { get; set; } | ||
|
||
public Store() | ||
{ | ||
Products = new List<Product>(); | ||
Staff = new List<Employee>(); | ||
} | ||
public Store() | ||
{ | ||
Products = new List<Product>(); | ||
Staff = new List<Employee>(); | ||
} | ||
|
||
public virtual void AddProduct(Product product) | ||
{ | ||
product.StoresStockedIn.Add(this); | ||
Products.Add(product); | ||
} | ||
public virtual void AddProduct(Product product) | ||
{ | ||
product.StoresStockedIn.Add(this); | ||
Products.Add(product); | ||
} | ||
|
||
public virtual void AddEmployee(Employee employee) | ||
{ | ||
employee.Store = this; | ||
Staff.Add(employee); | ||
} | ||
public virtual void AddEmployee(Employee employee) | ||
{ | ||
employee.Store = this; | ||
Staff.Add(employee); | ||
} | ||
} | ||
} |
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.