Пример #1
0
		/// <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;
		}
Пример #2
0
		/// <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;
		}
Пример #3
0
        /// <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);
        }
Пример #4
0
        /// <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);
        }