public async Task <IHttpActionResult> Postltd_tbl_userdetails(ltd_tbl_userdetails ltd_tbl_userdetails)
        {
            ltd_tbl_userdetails.ltd_UserId       = ltd_tbl_userdetails.ltd_Email;
            ltd_tbl_userdetails.ltd_Active       = true;
            ltd_tbl_userdetails.ltd_CreatedDate  = DateTime.UtcNow;
            ltd_tbl_userdetails.ltd_ModifiedDate = DateTime.UtcNow;
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ltd_tbl_userdetails.Add(ltd_tbl_userdetails);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (ltd_tbl_userdetailsExists(ltd_tbl_userdetails.ltd_UserId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = ltd_tbl_userdetails.ltd_UserId }, ltd_tbl_userdetails));
        }
        public async Task <IHttpActionResult> Putltd_tbl_userdetails(string id, ltd_tbl_userdetails ltd_tbl_userdetails)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != ltd_tbl_userdetails.ltd_UserId)
            {
                return(BadRequest());
            }

            db.Entry(ltd_tbl_userdetails).State = System.Data.Entity.EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ltd_tbl_userdetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> Getltd_tbl_userdetails(string id)
        {
            ltd_tbl_userdetails ltd_tbl_userdetails = await db.ltd_tbl_userdetails.FindAsync(id);

            if (ltd_tbl_userdetails == null)
            {
                return(NotFound());
            }

            return(Ok(ltd_tbl_userdetails));
        }
        public async Task <IHttpActionResult> Deleteltd_tbl_userdetails(string id)
        {
            ltd_tbl_userdetails ltd_tbl_userdetails = await db.ltd_tbl_userdetails.FindAsync(id);

            if (ltd_tbl_userdetails == null)
            {
                return(NotFound());
            }

            db.ltd_tbl_userdetails.Remove(ltd_tbl_userdetails);
            await db.SaveChangesAsync();

            return(Ok(ltd_tbl_userdetails));
        }