This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note: this interface will be referenced in loaded source code: | |
public interface ICharacter | |
{ | |
int Height { get; } | |
string Language { get; } | |
} | |
public class Human : ICharacter | |
{ | |
public int Height { get { return UnityEngine.Random.Range(150, 200); } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var id = 1; | |
using (var db = new entityContext()) | |
{ | |
// Select entity | |
var entity = db.dbset.FirstOrDefault(e => e.ID == id); | |
if (entity != null) | |
{ | |
// Remove Entity | |
db.dbset.Remove(entity); | |
db.SaveChanges(); |