public static NeptunePage GetNeptunePageByPageType(NeptunePageType neptunePageType) { var neptunePage = HttpRequestStorage.DatabaseEntities.NeptunePages.SingleOrDefault(x => x.NeptunePageTypeID == neptunePageType.NeptunePageTypeID); Check.RequireNotNull(neptunePage); return(neptunePage); }
/// <summary> /// Enum types are equal by primary key /// </summary> public bool Equals(NeptunePageType other) { if (other == null) { return(false); } return(other.NeptunePageTypeID == NeptunePageTypeID); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static NeptunePage CreateNewBlank(NeptunePageType neptunePageType) { return(new NeptunePage(neptunePageType)); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public NeptunePage(NeptunePageType neptunePageType) : this() { // Mark this as a new object by setting primary key with special value this.NeptunePageID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.NeptunePageTypeID = neptunePageType.NeptunePageTypeID; }