/// <summary> /// Gets the upload model for the given parent id. Note that this method /// is only valid for parents with a single upload attached to them. /// </summary> /// <param name="id">The parent id</param> /// <returns>The model</returns> public static EditModel GetByParentId(Guid id) { var m = new EditModel() { Upload = Upload.GetByParentId(id).FirstOrDefault() }; if (m.Upload == null) m.Upload = new Upload(); return m; }
/// <summary> /// Gets the edit model for the given id. /// </summary> /// <param name="id">The upload id</param> /// <returns>The model</returns> public static EditModel GetById(Guid id) { var m = new EditModel() { Upload = Upload.GetSingle(id) }; if (m.Upload == null) m.Upload = new Upload(); return m; }
/// <summary> /// Gets the upload model for the given parent id. Note that this method /// is only valid for parents with a single upload attached to them. /// </summary> /// <param name="id">The parent id</param> /// <returns>The model</returns> public static EditModel GetByParentId(Guid id) { var m = new EditModel() { Upload = Upload.GetByParentId(id).FirstOrDefault() }; if (m.Upload == null) { m.Upload = new Upload(); } return(m); }
/// <summary> /// Gets the edit model for the given id. /// </summary> /// <param name="id">The upload id</param> /// <returns>The model</returns> public static EditModel GetById(Guid id) { var m = new EditModel() { Upload = Upload.GetSingle(id) }; if (m.Upload == null) { m.Upload = new Upload(); } return(m); }