/// <summary> /// Create a new HoloDisk object. /// </summary> /// <param name="progressivo">Initial value of the Progressivo property.</param> /// <param name="codice">Initial value of the Codice property.</param> /// <param name="hacking">Initial value of the Hacking property.</param> public static HoloDisk CreateHoloDisk(global::System.Int64 progressivo, global::System.String codice, global::System.Int64 hacking) { HoloDisk holoDisk = new HoloDisk(); holoDisk.Progressivo = progressivo; holoDisk.Codice = codice; holoDisk.Hacking = hacking; return holoDisk; }
/// <summary> /// Deprecated Method for adding a new object to the HoloDisks EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHoloDisks(HoloDisk holoDisk) { base.AddObject("HoloDisks", holoDisk); }
public bool InsertNewDisk(string codice, string contenuto, long hacking) { codice = codice.Trim(); try { var verifyExists = from dischi in context.HoloDisks where dischi.Codice == codice select dischi; if (verifyExists.Count() > 0) { return false; } HoloDisk newDisco = new HoloDisk(); newDisco.Codice = codice; newDisco.Contenuto = contenuto; newDisco.Hacking = hacking; newDisco.CodiceQr = Guid.NewGuid(); context.HoloDisks.AddObject(newDisco); return true; } catch { return false; } }