Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model classes #26

Closed
aeadbhard opened this issue Nov 7, 2022 · 3 comments
Closed

Model classes #26

aeadbhard opened this issue Nov 7, 2022 · 3 comments

Comments

@aeadbhard
Copy link

Thanks for such a great library. I want to use it in a project, but I am new to SAP Business One and I am not sure what would I need to do or research in order to create the SAP B1 model classes. What would you recommend? Thanks!

@bgmulinari
Copy link
Owner

Hi, @aeadbhard.

SAP Business One model classes to be used with B1SLayer can be ordinary C# classes, each representing an entity in SAP and containing its properties. The name and type of each property should match what is defined in the Service Layer metadata.

It's worth noting that your C# model classes don't need to have all the properties of a given SAP entity, as they can have an extensive list of properties and in most cases you will only need a few, which will vary depending on your need.

Here's an example of a model class for the BusinessPartner entity:

public class BusinessPartner
{
    public string CardCode { get; set; }
    public string CardName { get; set; }
    public string CardType { get; set; }
    public string EmailAddress { get; set; }
    public int GroupCode { get; set; }
    // (...) just add all the properties you need, making sure the name and type matches the metadata
}

@aeadbhard
Copy link
Author

aeadbhard commented Nov 8, 2022 via email

@bgmulinari
Copy link
Owner

You're welcome. I'll be closing the issue as your doubt seems to be cleared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants