public ActionResult AddMeta(Metadata metaData) { if (ModelState.IsValid) { repository.AddMetadata(metaData); ViewBag.ClubId = metaData.ClubID; return View("AddMeta"); } else { ViewBag.ClubId = "Error"; return View("AddMeta"); } }
/// <summary> /// Deprecated Method for adding a new object to the Metadatas EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMetadatas(Metadata metadata) { base.AddObject("Metadatas", metadata); }
/// <summary> /// Create a new Metadata object. /// </summary> /// <param name="metadataID">Initial value of the MetadataID property.</param> /// <param name="metadataType">Initial value of the MetadataType property.</param> /// <param name="metadataValue">Initial value of the MetadataValue property.</param> /// <param name="clubID">Initial value of the ClubID property.</param> public static Metadata CreateMetadata(global::System.Int32 metadataID, global::System.String metadataType, global::System.String metadataValue, global::System.Int32 clubID) { Metadata metadata = new Metadata(); metadata.MetadataID = metadataID; metadata.MetadataType = metadataType; metadata.MetadataValue = metadataValue; metadata.ClubID = clubID; return metadata; }
public Int32 AddMetadata(Metadata metaData) { entities.Metadatas.AddObject(metaData); entities.SaveChanges(); return metaData.MetadataID; }