Created
January 27, 2018 18:38
-
-
Save amarwadi/14bda503401c1848409d753e659a0910 to your computer and use it in GitHub Desktop.
Installment Model with MongoDB Serialization attributes
This file contains hidden or 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
[BsonIgnoreExtraElements] | |
public class Installment : AggregateRoot | |
{ | |
[BsonId, BsonRepresentation(BsonType.ObjectId)] | |
public string Id { get; protected set; } | |
[BsonRequired] | |
public string Title { get; protected set; } | |
public string Description { get; protected set; } | |
[BsonRequired] | |
public uint InstallmentFrequencyInDays { get; protected set; } | |
[BsonRequired] | |
public decimal DownPayment { get; protected set; } | |
[BsonRequired] | |
public uint TotalInstallments { get; protected set; } | |
public Installment(string id, string title, string description, uint installmentFrequencyDays, decimal downPayment, uint totalInstallments) | |
{ | |
Id = id; | |
Title = title; | |
Description = description; | |
InstallmentFrequencyInDays = installmentFrequencyDays; | |
DownPayment = downPayment; | |
TotalInstallments = totalInstallments; | |
Id = Guid.NewGuid().ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment