public static ComputerModel FromRepositoryType(Computer model, DbSet<ScriptModel> scripts, DbSet<UserModel> users) { var result = new ComputerModel { AccessKey = model.AccessKey, Address = model.Address, EncryptionKey = model.EncryptionKey, Id = model.Id, LastPing = model.LastPing, LastScript = model.LastScript == null ? null : scripts.Find(model.LastScript.Id), Name = model.Name, Owner = users.Find(model.Owner.Id) }; return result; }
public bool Equals(ComputerModel that) { if (that == null) { return false; } if (this.Id != that.Id) { return false; } return true; }