web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

How create Data Model in MPOS D365 F&O

(0) ShareShare
ReportReport
Posted on by 15

pastedimage1594136237667v1.png

[DataMember]
[Column(DayColumn)]
public int DayOfWeek
{
get { return (int)this[DayColumn]; }
set { this[DayColumn] = value; }
}

/// <summary>
/// Gets or sets the open time.
/// </summary>
[DataMember]
[Column(OpenTimeColumn)]
public int OpenTime
{
get { return (int)this[OpenTimeColumn]; }
set { this[OpenTimeColumn] = value; }
}

/// <summary>
/// Gets or sets the closing time.
/// </summary>
[DataMember]
[Column(CloseTimeColumn)]
public int CloseTime
{
get { return (int)this[CloseTimeColumn]; }
set { this[CloseTimeColumn] = value; }
}

/// <summary>
/// Gets or sets the id.
/// </summary>
[Key]
[DataMember]
[Column(IdColumn)]
public long Id
{
get { return (long)this[IdColumn]; }
set { this[IdColumn] = value; }
}
}

[Help]

code above, how to generate it ?, Can it be generated directly from the database / tool or only write from scratch?

thanks,

Regrds. F20

I have the same question (0)
  • Verified answer
    Ramshenkar Profile Picture
    Microsoft Employee on at

    It really does not need to be much complex as shown in sample extension.  Refer below simplified form of your code.  Whats important is [DataMember attribute for each property and  [Key attribute for primary property. 

    class Storehour
    {
    [DataMember]
    public int DayOfWeek { get; set; }
    
    [DataMember]
    public int OpenTime { get; set; }
    
    [DataMember] 
    public int CloseTime { get; set; }
    
    [Key]
    [DataMember] 
    public long Id { get; set; } 
    }

    You can generate it using visual studio past special command, if you have JSON or XML data string. For example I have below json string - 

    {"balance": 1000.21, "num":100, "is_vip":true, "name":"foo"}

    Copy it and open a empty c# class, use visual studio menu "Edit-> Paste Special -> Paste JSON as Class". It will create below structure for you. Decorate it with attribute and that's it. You can also use XML string to generate the class.  

    public class Rootobject
    {
    public float balance { get; set; }
    public int num { get; set; }
    public bool is_vip { get; set; }
    public string name { get; set; }
    }

    Hope it helps you. 

    Regards, 

    Ram

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 164 Super User 2026 Season 1

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 105 Super User 2026 Season 1

#3
Zain Mehmood Profile Picture

Zain Mehmood 89 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans