public async Task<ActionResult> Create( Shop model, HttpPostedFileBase PhotoImage)
{
if (ModelState.IsValid)
{
byte[] imageData = null;
using (var binaryReader = new BinaryReader(PhotoImage.InputStream))
{
imageData = binaryReader.ReadBytes(PhotoImage.ContentLength);
}
model.Photo = imageData;
db.Shops.Add(model);
await db.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(model);
}
<input type="file" name="PhotoImage" />
public partial class Order
{
public string CustomerName { get; set; }
public id CarLabelId { get; set; }
public CarLabel CarLabel { get; set; }
}
public class CarLabel
{
public int Id { get; set; }
public string NameCar { get; set; }
}
public class Check{
public int Id {get;set;}
public ICollection<ProductItem> ProductItem {get;set;}
}
public class Product{
public int Id {get;set;}
public ICollection<ProductItem> ProductItem {get;set;}
}
public class ProductItem{
public int ProductId {get;set;}
public Product Product {get;set;}
public int CheckId {get;set;}
public Check Check {get;set;}
public int Count {get;set;}
}
context.Subdivs.Include(i=>i.Realtor).First(s=>s.Id == id):
var summ = _context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 9).Sum(n=>n.Goal).ToString();
var summ1 = _context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 1).Sum(n => n.Goal).ToString();
var calendar = _context.Matchs.Where(i => i.ChampionatId == id).Select(f => new List<string> {
_context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 9).Sum(n=>n.Goal).ToString(),
_context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 1).Sum(n => n.Goal).ToString()
});