예제 #1
0
 public IMacro?GetById(int id)
 {
     using (var scope = ScopeProvider.CreateCoreScope(autoComplete: true))
     {
         return(_macroRepository.Get(id));
     }
 }
예제 #2
0
 /// <summary>
 /// Gets an <see cref="IMacro"/> object by its alias
 /// </summary>
 /// <param name="alias">Alias to retrieve an <see cref="IMacro"/> for</param>
 /// <returns>An <see cref="IMacro"/> object</returns>
 public IMacro GetByAlias(string alias)
 {
     using (var scope = ScopeProvider.CreateScope(autoComplete: true))
     {
         var q = Query <IMacro>().Where(x => x.Alias == alias);
         return(_macroRepository.Get(q).FirstOrDefault());
     }
 }