Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to exclude an auto generated column in UpdateAsync call

$
0
0

Hi,

Greetings!

I have an Azure Mobile Service Client in backend. I am making an update to DB by UpdateAsync Call which throws the below Error.

Error : The column "OrderId" cannot be modified because it is either a computed column or is the result of a UNION operator.

Column OrderId is an Auto Generated column in DB.

I have tried [NotMapped] [DataBaseGeneratedOption] in my model and nothing seems to be working.

**Code: **
await App.client.GetTable().UpdateAsync(orderupd);

Model Class:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace SevenDashboard.Models
{
public class Orders
{
public string id { get; set; }
public string HotelId { get; set; }
public string TableName { get; set; }
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Computed)]
public string OrderId { get; set; }
public string OrderedBy { get; set; }
public string OrderType { get; set; }
public string OrderStatus { get; set; }
}

Please help!

Regards,
Mahesh B.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>