oop_II-6/EHEC_Server/EHEC_Server/Origin.cs

50 lines
1.6 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace EHEC_Server
{
using System;
using System.Collections.Generic;
public partial class Origin
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Origin()
{
this.Exam = new HashSet<Exam>();
}
public int OriginId { get; set; }
public int SicknessId { get; set; }
public string Name { get; set; }
public string Street { get; set; }
public string City { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
public bool CreateOrigin(Origin origin)
{
try
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Origin.Add(origin);
ctx.SaveChanges();
}
return true;
}
catch (Exception)
{
return false;
}
}
}
}