Example #1
0
 public void Add([FromBody] MapLegend item)
 {
     using (var repository = new MapLegendRepository())
     {
         var manager = new MapLegendManager(repository);
         manager.AddOrUpdate(item);
     }
 }
Example #2
0
 // GET api/<controller>/5
 /// <summary>
 /// The get.
 /// </summary>
 /// <param name="id">
 /// The predicate.
 /// </param>
 /// <returns>
 /// </returns>
 public MapLegend GetById(int id)
 {
     using (var repository = new MapLegendRepository())
     {
         var manager = new MapLegendManager(repository);
         return(manager.Get().Single(p => p.Id == id));
     }
 }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public MapLegend GetByName(string name)
 {
     using (var repository = new MapLegendRepository())
     {
         var manager = new MapLegendManager(repository);
         return(manager.Get().Single(p => p.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)));
     }
 }
Example #4
0
 /// <summary>
 /// The get.
 /// </summary>
 /// <returns>
 /// </returns>
 public IEnumerable <MapLegend> Get()
 {
     using (var repository = new MapLegendRepository())
     {
         var manager = new MapLegendManager(repository);
         return(manager.Get());
     }
 }