interface IBaseService<T>:IDisposable where T: BaseEntity
{
AccountModel Get<T>(int id) where T : class, new();
AccountModel GetAll<T>() where T : class, new();
bool Save<T>(AccountModel entity);
bool Delete(int id);
}
class BaseEntity {
public int Id {get;set;}
}
public BaseService: IBaseService<T> {
protected List<T> Source = new List<T>();
public bool Delete(int id) {
foreach (var a in Source )
{
if (a.Id == id)
{
Source.Remove(a);
}
}
return true;
}
}
@{
ViewBag.Title = "Upload";
}
<h3>Выберите файл для загрузки</h3>
@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new {enctype="multipart/form-data"}))
{
<input type="file" name="upload" /><br>
<input type="submit" value="Загрузить" />
}
ProcessStartInfo psi;
psi = new ProcessStartInfo("cmd", $"git commit -a -m { backup_name }");
Process.Start(psi);
private int _z;
public int Z {
get => _z;
set{
_z = value;
OnPropertyChanged(nameof(Z));
} }
<TextBox Text ="{Binding Z}" />