/// <summary> /// Enum types are equal by primary key /// </summary> public bool Equals(FileResourceMimeType other) { if (other == null) { return(false); } return(other.FileResourceMimeTypeID == FileResourceMimeTypeID); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public FileResource(FileResourceMimeType fileResourceMimeType, string originalBaseFilename, string originalFileExtension, Guid fileResourceGUID, byte[] fileResourceData, Person createPerson, DateTime createDate) : this() { // Mark this as a new object by setting primary key with special value this.FileResourceID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.FileResourceMimeTypeID = fileResourceMimeType.FileResourceMimeTypeID; this.OriginalBaseFilename = originalBaseFilename; this.OriginalFileExtension = originalFileExtension; this.FileResourceGUID = fileResourceGUID; this.FileResourceData = fileResourceData; this.CreatePersonID = createPerson.PersonID; this.CreatePerson = createPerson; createPerson.FileResourcesWhereYouAreTheCreatePerson.Add(this); this.CreateDate = createDate; }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static FileResource CreateNewBlank(FileResourceMimeType fileResourceMimeType, Person createPerson) { return(new FileResource(fileResourceMimeType, default(string), default(string), default(Guid), default(byte[]), createPerson, default(DateTime))); }