40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
namespace YLErp.BLL
|
|
{
|
|
public class synthetic_underlyingBLL
|
|
{
|
|
public static IQueryable<SyntheticUnderlying> GetQuery()
|
|
{
|
|
return new YLContext().synthetic_underlying.AsNoTracking();
|
|
}
|
|
|
|
public static SyntheticUnderlying GetByName(string name)
|
|
{
|
|
if (string.IsNullOrEmpty(name)) return null;
|
|
|
|
using (var db = new YLContext())
|
|
{
|
|
return db.synthetic_underlying.AsNoTracking().FirstOrDefault(n => n.Name == name);
|
|
}
|
|
}
|
|
|
|
public static string GetUnderlyingTipsInfo(string name)
|
|
{
|
|
if (string.IsNullOrEmpty(name)) return null;
|
|
|
|
using (var db = new YLContext())
|
|
{
|
|
return db.synthetic_underlying.AsNoTracking().FirstOrDefault(n => n.Name == name)?.UnderlyingTipsInfo;
|
|
}
|
|
}
|
|
|
|
|
|
public static List<SyntheticUnderlying> GetListByNames(List<string> names)
|
|
{
|
|
using (var db = new YLContext())
|
|
{
|
|
return db.synthetic_underlying.AsNoTracking().Where(n => names.Contains(n.Name)).ToList();
|
|
}
|
|
}
|
|
}
|
|
}
|