first push
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ModelsLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
public class DesireService
|
||||
{
|
||||
private readonly IDbContextFactory<PhotoShareDbContext> _factory;
|
||||
private readonly IWebHostEnvironment _env;
|
||||
|
||||
public DesireService(IDbContextFactory<PhotoShareDbContext> factory, IWebHostEnvironment env)
|
||||
{
|
||||
_factory = factory;
|
||||
_env = env;
|
||||
}
|
||||
|
||||
public List<string> GetDEsireShooting()
|
||||
{
|
||||
using var db = _factory.CreateDbContext();
|
||||
|
||||
return db.DesireDb.Select(ds => ds.Desire).ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user