public static Position GetPosition(Guid? uid) { if (uid == null) return new Position(); var filter = new PositionFilter(); filter.Uids.Add((Guid)uid); return FiresecService.GetPositions(filter).ToList().FirstOrDefault(); }
public IEnumerable<Position> GetPositions(PositionFilter filter) { try { var positions = new List<Position>(); var databasePositions = Context.Position.ToList().Where(x => IsInFilter(x, filter)).ToList(); databasePositions.ForEach(x => positions.Add(Translator.Translate(x))); return positions; } catch { return new List<Position>(); } }
bool IsInFilter(FiresecService.SKUD.DataAccess.Position item, PositionFilter filter) { if (filter == null) return true; bool isInUids = !filter.HasUids || filter.Uids.Any(x => item.Uid == x); return isInUids; }
public IEnumerable<Position> GetPositions(PositionFilter filter) { return _skud.GetPositions(filter); }
public static IEnumerable<Position> GetPositions(PositionFilter filter) { return FiresecService.GetPositions(filter); }