예제 #1
0
 /// <summary>
 /// Generic amoCRM repository constructor.
 /// </summary>
 ///<param name = "acc" ><see cref="AmoAccount"/> object, must implement <see cref="IAmoAccount"/>.</param>
 public GenericAmoRepository(IAmoAccount acc)
 {
     _auth       = acc.auth;
     _entityLink = (string)typeof(T).GetProperty("entityLink").GetValue(null, null);   //IModel.entityLink;
     _apiAddress = $"https://{acc.subdomain}.amocrm.ru/api/v4/";
 }
예제 #2
0
 public static GenericAmoRepository <T> GetRepo <T>(this IAmoAccount acc) where T : IEntity, new()
 {
     return(new GenericAmoRepository <T>(acc));
 }