public long GetLastId() { var lastId = noticeRepository.GetAll().Select(x => x.Id).Max(); //var lastObj = noticeRepository.GetAll().OrderByDescending(x => x.Id).FirstOrDefault(); //if (lastObj != null) //{ // return lastObj.Id; //} //return 0; return(lastId); }
/// <summary> /// Function to get all Notice /// </summary> /// <returns>Notice</returns> public IEnumerable <Notice> GetAll() { return(Repository.GetAll().Select(N => N.ToClient())); }