/// <summary> /// This method get application record by pass ip parameter synchronously /// </summary> /// <param name="ip"></param> /// <returns> /// Return null or one record of application that IP field is equal to passed parameter /// </returns> public Models.Application GetApplicationByIP(string ip) { if (string.IsNullOrWhiteSpace(ip) == true) { return(null); } Models.Application application = DbSet .Where(current => current.IP == ip) .FirstOrDefault() .Application ; return(application); }
/// <summary> /// This method get application record by pass url parameter synchronously /// </summary> /// <param name="url"></param> /// <returns> /// Return null or one record of application that url field is equal to passed parameter /// </returns> public Models.Application GetApplicationByURL(string url) { if (string.IsNullOrWhiteSpace(url) == true) { return(null); } Models.Application application = DbSet .Where(current => current.Url == url) .FirstOrDefault() .Application ; return(application); }
/// <summary> /// This method get application record by pass ip parameter asynchronously /// </summary> /// <param name="ip"></param> /// <returns> /// Return null or one record of application that IP field is equal to passed parameter /// </returns> public virtual async System.Threading.Tasks.Task <Models.Application> GetApplicationByIPAsync(string ip) { if (string.IsNullOrWhiteSpace(ip) == true) { return(null); } Models.Application application = null; await System.Threading.Tasks.Task.Run(() => { application = DbSet .Where(current => current.IP == ip) .FirstOrDefault() .Application ; }); return(application); }