/// <summary> /// Initializes a new instance of the <see cref="HairStyleViewModel"/> class. /// </summary> /// <param name="hairStyle"> /// The hair style. /// </param> public HairStyleViewModel(HairStyle hairStyle, IEnumerable<string> images) { _hairStyle = hairStyle; AllImages = images.Select(image => new SelectListItem { Text = Path.GetFileName(image), Value = Path.GetFileName(image) }).ToArray(); }
public HairStyle ToHairStyle() { var hairStyle = new HairStyle(); hairStyle.id = Id; hairStyle.name = Name; return hairStyle; }
public ActionResult Create() { var hairStyle = new HairStyle(); var allImages = _imageRepository.GetAllImages(Server); return View(new HairStyleViewModel(hairStyle, allImages) { BigImages = new List<string>(), SmallImage = allImages.First() }); }
/// <summary> /// Initializes a new instance of the <see cref="HairStyleViewModel"/> class. /// </summary> /// <param name="hairStyle"> /// The hair style. /// </param> public HairStyleViewModel(HairStyle hairStyle) : this(hairStyle, new string[0]) { }
/// <summary> /// Initializes a new instance of the <see cref="HairStyleViewModel"/> class. /// </summary> public HairStyleViewModel() { _hairStyle = new HairStyle(); }
public HairStyleProxy(HairStyle hairStyle) { Id = hairStyle.id; Name = hairStyle.name; }
/// <summary> /// Create a new HairStyle object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> public static HairStyle CreateHairStyle(global::System.Int32 id, global::System.String name) { HairStyle hairStyle = new HairStyle(); hairStyle.id = id; hairStyle.name = name; return hairStyle; }
/// <summary> /// Deprecated Method for adding a new object to the HairStyles EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHairStyles(HairStyle hairStyle) { base.AddObject("HairStyles", hairStyle); }