What’s new with CodeFluent Entities 801?

December 19, 2014 Leave a comment

Today we release the build 801. This build includes lots of new features:

Cache Producer and array

 

The Cache Producer creates a unique key for each method call based on the method name and its parameter values:

cacheKey = SimpleCacheManager.BuildCacheKey("ad5a4755bc1df9345e1a73e2ae38",
                                             pageIndex, pageSize, 
                                             pageOptions, ids);

The BuildCacheKey method handles common parameter types such as String, Boolean, Integer, DateTime, etc. But it does not handle complex types such as array for the simple reason that there are many ways to handle them. We decided to let you handle those cases as you want depending of your context. We introduce a new optional parameter “Build Cache Key Method Name”:

The generated code will be:

cacheKey = CustomerCollection.CustomBuildCacheKey("ad5a4755bc1df9345e1a73e2ae38",
                                                   pageIndex, pageSize, 
                                                   pageOptions, ids);

This way you can create the key the way you want!

Use existing .NET enumeration and type

 

CodeFluent Entities can reuse existing .NET enumeration or .NET type. The modeler now lets you add those type on the surface:

The enumeration and all its values will be added to the surface:

The same apply with .NET type such as “System.Drawing.Point”

SQL Server Producer & “Nullable” Table Value Parameters

 

When you create a CFQL method with persistence nullable array parameter:

LOAD(guid[]
ids?) WHERE Id IN (@ids)

The SQL Server producer generates the following code:

DECLARE @_c_ids int; SELECT @_c_ids= COUNT(*) FROM @ids
IF(@_c_ids = 0)
BEGIN
    SELECT [Customer].[Customer_Id], [Customer].[Customer_FirstName], 
           [Customer].[Customer_LastName]
        FROM [Customer]
END
ELSE
BEGIN
    SELECT [Customer].[Customer_Id], [Customer].[Customer_FirstName], 
           [Customer].[Customer_LastName]
        FROM [Customer]
        WHERE [Customer].[Customer_Id] IN (SELECT * FROM @ids)
END

IS NULL is translated to Array is empty because TVP cannot be NULL. We think this check is the most logical in this case.

Starter Wizard

 

Starter wizard supports new project templates:

Pivot Script improvements

 

The SQL Server Pivot Script producer has many new options to select what to produce (tables, procedures, functions, etc.):

Sorting Project Resources

 

Project resources grid allows to sort rows by name, class or value:

Visual Studio 2015 Preview

 

As we mentioned this week, CodeFluent Entities now supports Visual Studio 2015 Preview.

codefluent2015

You can download this build here, or update your version using the Licensing tool. Remember that you can follow the latest new features and bug fixes of CodeFluent Entities subscribing to this RSS.

Happy downloading!

The R&D Team

Categories: News

Visual Studio 2015 Preview

December 15, 2014 Leave a comment

One month ago, we told you that CodeFluent Entities runs great on Visual Studio 2013 Community. The story continues and CodeFluent Entities now supports Visual Studio 2015 Preview.

visual studio 2015

Indeed, a preview of VS 2015 is available for those ready to dive into next-generation development tool. We’re especially excited to announce that you can create or open your CodeFluent Entities models directly from Visual Studio 2015 :

codefluent2015

You can learn more about the new features of Visual Studio 2015 Preview here:

You can download the latest version of CodeFluent Entities here, or update your version using the Licensing tool. Remember that you can follow the latest new features and bug fixes of CodeFluent Entities subscribing to this RSS.

Happy downloading,

The R&D Team

Categories: News Tags:

Multi-tenant using multiple Schemas

December 4, 2014 Leave a comment

In this post we will see how to create a multi-tenant application using one schema by tenant. The idea is to create one CodeFluent Entities model and use it to generate as many database schemas as needed.

The generated database will contains one schema by tenant:

But to keep the usage as simple as possible, only one Business Object Model is generated. The schema is selected at runtime:

Note: The following procedure uses the Custom meta-compiler host feature which is available only with CodeFluent Entities Personal or Ultimate

Generate the database

 

The idea is to keep the model untouched, so we create a console application which:

  • Load the CodeFluent Entities model
  • Change entity schema in memory (the original model won’t be changed)
  • Generate code
class Program
{
    private static string _schema;
    private static string _projectPath;
    private static bool _changeTargetDirectory;

    static void Main()
    {
        _projectPath = CommandLineUtilities.GetArgument("path", (string)null) ?? CommandLineUtilities.GetArgument(0, (string)null);
        _schema = ConvertUtilities.Nullify(CommandLineUtilities.GetArgument("schema", (string)null) ?? CommandLineUtilities.GetArgument(1, (string)null), true);
        _changeTargetDirectory = CommandLineUtilities.GetArgument("changeTargetDirectory", true);

        // Load the model
        Project project = new Project();
        project.Entities.ListChanged += Entities_ListChanged; // Change schema as soon as the entity is loaded
        project.Load(_projectPath, ProjectLoadOptions.Default);

        // Update producer target directory
        if (!string.IsNullOrEmpty(_schema) && _changeTargetDirectory)
        {
            foreach (var producer in project.Producers)
            {
                var sqlServerProducer = producer.Instance as SqlServerProducer;
                if (sqlServerProducer != null)
                {
                    sqlServerProducer.Production += SqlServerProducer_Production;
                }
            }
        }

        // Generate code
        project.Produce();
    }

    private static readonly HashSet<IProducer> _producers = new HashSet<IProducer>();
    private static void SqlServerProducer_Production(object sender, ProductionEventArgs e)
    {
        SqlServerProducer sqlServerProducer = sender as SqlServerProducer;
        if (sqlServerProducer == null)
            return;

        if (_producers.Contains(sqlServerProducer))
            return;

        sqlServerProducer.EditorTargetDirectory = Path.Combine(sqlServerProducer.EditorTargetDirectory, _schema);
        _producers.Add(sqlServerProducer);
    }

    private static void Entities_ListChanged(object sender, ListChangedEventArgs e)
    {
        if (e.ListChangedType != ListChangedType.ItemAdded)
            return;

        var entityCollection = sender as EntityCollection;
        if (entityCollection == null || e.NewIndex < 0 || e.NewIndex >= entityCollection.Count)
            return;

        Entity entity = entityCollection[e.NewIndex];
        Console.WriteLine("Changing schema of entity '{0}' from '{1}' to '{2}'", entity.ClrFullTypeName, entity.Schema, _schema);
        entity.Schema = _schema;
    }
}

That’s it… We can now use this console application to generate the persistence layer:

SoftFluent.MultiTenantGenerator.exe "Sample.Model\Sample.Model.cfxproj" "SoftFluent"
SoftFluent.MultiTenantGenerator.exe "Sample.Model\Sample.Model.cfxproj" "Contoso"

You can create a script to call program this for each tenant.

Select the right tenant at runtime

 

We generate only one Business Object Model (BOM) for all tenants. This BOM access by default to the schema specified in the CodeFluent Entities model. In our case we want to change this schema at runtime depending on the context (user, Uri, etc.).

To access the database, the generated code use CodeFluentPersistence:

CodeFluentPersistence has a hook system (ICodeFluentPersistenceHook) that allows to change the default CodeFluentPersistence behavior. In our case the idea is to change the CreateStoredProcedureCommand method behavior to use the right schema. Here’s the code:

public class SchemaPersistenceHook : BasePersistenceHook
{
    private bool _processing = false;
    public override bool BeforeCreateStoredProcedureCommand(string schema, string package, string intraPackageName, string name)
    {
        if (_processing)
            return false;

        _processing = true;
        try
        {
            string currentSchema = GetTenant();
            Persistence.CreateStoredProcedureCommand(currentSchema, package, intraPackageName, name);
        }
        finally
        {
            _processing = false;
        }

        return true;
    }

    public virtual string GetTenant()
    {
            // TODO: Implement your own logic
            return CodeFluentUser.Current.UserDomainName;
    }
}

Finally we have to declare our persistence hook in the configuration file so CodeFluentPersistence will use it automatically:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="Sample" type="CodeFluent.Runtime.CodeFluentConfigurationSectionHandler, CodeFluent.Runtime" />
  </configSections>

  <Sample persistenceHookTypeName="Sample.SchemaPersistenceHook, Sample" />
</configuration>

That’s it. With a few lines of codes and the power of CodeFluent Entities you can change the default behavior to fit your needs. Can you do the same with other products?

The source code is available on our GitHub repository.

Happy tenanting,

The R&D team

CodeFluent Entities and SignalR

November 21, 2014 Leave a comment

ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications. What is “real-time web” functionality? It’s the ability to have your server-side code push content to the connected clients as it happens, in real-time.

Let’s see how easy it is to use CodeFluent Entities with SignalR! This post introduces SignalR development by using CodeFluent Entities and showing how to create an application that shares the state of an CodeFluent entity (Customer) with other clients in real time.

Setting up the solution

The solution contains 4 projects:

  • The CodeFluent Entities model
  • A class project to contains the generated Business Object Model
  • The SignalR server (Console application)
  • The SignalR client (WPF application)

The CodeFluent Entities model
The model is very simple, just one entity:

To generate the server code we add the SQL Server Producer and the Business Object Model producer.

SignalR uses Json.NET to serialize object. The way this library finds a way to serialize an object is weird and does not works with generated object by default because of the following attribute:

[TypeConverterAttribute(typeof(CodeFluent.Runtime.Design.NameTypeConverter))]

So we have to remove it so the object is serialize correctly:

To generate the client object we add the Service Model sub producer (with the same setting as above):

Don’t forget to remove runtime design attributes:

Finally the model project looks like:

The SignalR server

The server is a Console application. First we add the “Microsoft.AspNet.SignalR.SelfHost” nuget package.

We can register the SignalR server:

class Program
{
    static void Main()
    {
        using (WebApp.Start<Startup>("http://localhost:12345"))
        {
            Console.WriteLine("Server started");
            Console.ReadKey();
        }
    }
}

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        HubConfiguration hubConfiguration = new HubConfiguration();
        hubConfiguration.EnableDetailedErrors = true;
        app.MapSignalR(hubConfiguration);
    }
}

Now we can create the Customer hub:

public class CustomerHub : Hub
{
    public IEnumerable<Customer> Get()
    {
        return CustomerCollection.LoadAll();
    }

    public bool Save(Customer customer)
    {
        bool save = Customer.Save(customer);
        if (save)
            Clients.All.Saved(customer); // Notify clients

        return save;
    }

    public bool Delete(Customer customer)
    {
        bool delete = Customer.Delete(customer);
        if (delete)
            Clients.All.Deleted(customer.Id); // Notify clients

        return delete;
    }
}

The generated Business Object Model is easy to use with any technology J.

The SignalR Client

The client is a WPF application. First we need to add the “Microsoft.AspNet.SignalR.Client” nuget package.

The project already contains generated class from the model so we don’t need to create a Customer class:

Let’s create the XAML:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <Button Content="Load customers" Click="ButtonLoadCustomers_OnClick" Margin="5"/>
        </StackPanel>

        <DataGrid Grid.Row="1" x:Name="DataGrid" AutoGenerateColumns="False" RowEditEnding="DataGrid_RowEditEnding">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding EntityKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="Entity Key"/>
                <DataGridTextColumn Binding="{Binding FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="First Name"/>
                <DataGridTextColumn Binding="{Binding LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="Last Name"/>

                <DataGridTemplateColumn>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Command="Delete" Content="X" Click="ButtonDelete_OnClick" DataContext="{Binding}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>

Create the connection to the server and register callbacks:

private async Task<bool> EnsureProxy()
{
    if (HubProxy != null)
        return true;

    Connection = new HubConnection(ServerUri);
    HubProxy = Connection.CreateHubProxy("CustomerHub");

    // Register callbacks
    HubProxy.On<Customer>("Saved", OnCustomerSaved);
    HubProxy.On<Guid>("Deleted", OnCustomerDeleted);
    try
    {
        await Connection.Start();
        return true;
    }
    catch (HttpRequestException)
    {
        Connection.Dispose();
        Connection = null;
        MessageBox.Show("Unable to connect to server: Start server before connecting clients.");
        return false;
    }
}

Handle events:

private void OnCustomerDeleted(Guid id)
{
    var customerCollection = DataGrid.ItemsSource as CustomerCollection;
    if (customerCollection != null)
    {
        customerCollection.Remove(id);
    }
}

private void OnCustomerSaved(Customer customer)
{
    var customerCollection = DataGrid.ItemsSource as CustomerCollection;
    if (customerCollection != null)
    {
        var c = customerCollection[customer.Id];
        if (c != null)
        {
            customer.CopyTo(c, true); // Update existing customer
        }
        else
        {
            customerCollection.Add(customer); // Add new customer
        }
    }
}

Handle UI events (load, edit, delete):

private async void ButtonLoadCustomers_OnClick(object sender, RoutedEventArgs e)
{
    if (!await EnsureProxy())
        return;

    var customers = await HubProxy.Invoke<CustomerCollection>("Get");
    if (customers == null)
        customers = new CustomerCollection();

    BindingOperations.EnableCollectionSynchronization(customers, _lock);
    DataGrid.ItemsSource = customers;
}

private async void DataGrid_RowEditEnding(object sender, DataGridRowEditEndingEventArgs e)
{
    if (e.Cancel)
        return;

    var result = await HubProxy.Invoke<bool>("Save", e.Row.Item);
}

private async void ButtonDelete_OnClick(object sender, RoutedEventArgs e)
{
    var customer = ((Button)sender).DataContext as Customer;
    if (customer == null)
        return;

    if (!await EnsureProxy())
        return;

    var result = await HubProxy.Invoke<bool>("Delete", customer);
}

The Business Object Model and the Service Object Model are very easy to use with any .NET technologies such as SignalR or Web API.

If your SignalR API is as simple as the one we create, you can automate its creation with templates.

The code sample is available on our GitHub repository.

Happy Coding,

The R&D Team

Visual Studio Community 2013

November 17, 2014 Leave a comment

Visual Studio Community 2013 is a new, full-featured, and FREE addition to the Visual Studio product lineup.

We are thrilled to announce that CodeFluent Entities runs great on it!

Visual Studio 2013 Community Edition

You can learn more about the new features of Visual Studio Community 2013 here:

You can download the latest version of CodeFluent Entities here, or update your version using the Licensing tool. Remember that you can follow the latest new features and bug fixes of CodeFluent Entities subscribing to this RSS.

Happy downloading,

The R&D Team

Categories: News Tags: ,

Exploring the CodeFluent Runtime: Convert utilities

November 3, 2014 Leave a comment

Today, on the series Exploring the CodeFluent Runtime,  we are going to explore the useful ConvertUtilities class from the CodeFluent.Runtime or CodeFluent.Runtime.Client assembly.

First of all you need to reference the dll in your project and include the directive as follow:

using CodeFluent.Runtime.Utilities;

The CodeFluent.Runtime is a part of the CodeFluent Entities product or you can download the following nuget package.

ChangeType

Returns an instance of type T whose value is equivalent to a specified input object. If an error occurs, a computed default value of type T will be returned.

var convert1 = ConvertUtilities.ChangeType<int>("42");
// –> 42
ConvertUtilities.ChangeType<bool>("yes"); // –> True
ConvertUtilities.ChangeType<bool>("y"); // –> True
ConvertUtilities.ChangeType<bool>("1"); // –> True
ConvertUtilities.ChangeType<CultureInfo>(1036); // –> CultureInfo("fr-fr")
ConvertUtilities.ChangeType("10/30/2014", DateTime.Now, new CultureInfo("en-US")); // –> 'October  30<sup>Th</sup> 2014' fr-FR
ConvertUtilities.ChangeType("Monday, Tuesday Wednesday | 8", DayOfWeek.None); // –>  Monday | Tuesday | Wednesday | Thursday
// Available separators: space, comma, pipe

SetCurrentThreadCulture

Sets the current thread culture. Handles integer values as lcid (http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx)

ConvertUtilities.SetCurrentThreadCulture("fr-FR");
ConvertUtilities.SetCurrentThreadCulture(1036);
ConvertUtilities.SetCurrentThreadCulture("1036");

Decamelize
Decamelizes the specified text using default decamelization options.

ConvertUtilities.Decamelize("ProductName"); // –> "Product Name"
ConvertUtilities.Decamelize("ProductName", ConvertUtilities.DecamelizeOptions.ForceRestLower); // –> "Product name"

Evaluate

Evaluates the specified expression on a given container object (like Eval in Asp.Net WebForm). In case of an error, the defaultValue parameter will be returned.

ConvertUtilities.Evaluate(DateTime.Now, "TimeOfDay.Hours", typeof(int), defaultValue: 0); // –> 15 (depends of your time<span style="font-family:Wingdings;">J</span> )
ConvertUtilities.Evaluate(DateTime.Now, "TimeOf", typeof(int), defaultValue: 0);  // –> 0
ConvertUtilities.Evaluate(null, "TimeOfDay.Hours", typeof(int), defaultValue:  0); // –> 0 

ConcatenateCollection

Concatenates a collection into a string using a separator character. An expression is ran on each object in the collection using ASP.NET DataBinding syntax style.

List<DateTime> collection = new List<DateTime>
{
   new DateTime(2007, 10, 10),
   new DateTime(2010, 10, 10),
   new DateTime(2014, 10, 10)
};

ConvertUtilities.ConcatenateCollection(collection, "Year", " - "); //- > "2007 - 2010 - 2014"

FormatFileSize

Format file size in bytes to the correct unit.

ConvertUtilities.FormatFileSize(399960003); // –>  381,43 MB
ConvertUtilities.FormatFileSize(399960003, null, "N5", new CultureInfo("en-US")); // –> 381.43158 MB

FromFileExtension

Converts a file extension to the corresponding image format.

ConvertUtilities.FromFileExtension(".jpg"); // –> ImageFormat.Jpeg
ConvertUtilities.FromFileExtension("png"); // –> ImageFormat.Png

IsFlagsEnum

Determines whether the specified enum type has the Flags attribute.

Note: you can use Enum.HasFlag with .Net Framework 4.0 and higher.

ConvertUtilities.IsFlagsEnum(typeof(FileOptions)); // –> true 

GetMaxValue

Gets the maximum value for a given type.

ConvertUtilities.GetMaxValue(typeof(int)); // –> 2147483647 
ConvertUtilities.GetMaxValue(typeof(DateTime));// –> {12/31/9999 23:59:59}

GetUniqueName

Get a name guaranteed not to be in a given a list of names. This method appends numbers to a preferred name.

List<string> names = new List<string>
"Gérald",
"Alexandra",
"Lionel",
"Marc"
};
ConvertUtilities.GetUniqueName(names, "lionel", StringComparison.InvariantCultureIgnoreCase); // –>  lionel2
ConvertUtilities.GetUniqueName(names, "john", StringComparison.InvariantCultureIgnoreCase); // –> john

Nullify

Nullifies the specified string.

ConvertUtilities.Nullify("Windows", trim: true);// –> Windows
ConvertUtilities.Nullify("   ", trim: true);// –> Null
ConvertUtilities.Nullify("   ", trim: false);// –> "  "

RemoveDiacritics

Removes diacritics (accents) from a text.

ConvertUtilities.RemoveDiacritics("éàèçàöâ"); // –> eaecaoa

SplitToList

Splits a text into a collection of typed objects. Returned objects are automatically converted into the proper type if needed.

ConvertUtilities.SplitToList<int>("25,4,15,42", ',');// –> {25, 4, 15, 42}
ConvertUtilities.SplitToList<long>("255,TTT", ',');  // –>{255, 0} Takes the default values of Type 

ToHexa

Converts a byte array to its hexadecimal string representation.

ConvertUtilities.ToHexa(new byte[] {0x43, 0x6F, 0x64, 0x65});// –> "436F6465"

ToHexaDump

Converts a string to its hexadecimal dump representation.

ConvertUtilities.ToHexaDump("CodeFluent Entities");
//Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  0123456789ABCDEF
//--------  -----------------------------------------------  ----------------
//00000000  43 00 6F 00 64 00 65 00 46 00 6C 00 75 00 65 00  C.o.d.e.F.l.u.e.
//00000010  6E 00 74 00 20 00 45 00 6E 00 74 00 69 00 74 00  n.t. .E.n.t.i.t.
//00000020  69 00 65 00 73 00                                i.e.s.
ConvertUtilities.ToHexaDump(new byte[] {0x43, 0x6F, 0x64, 0x65});
//Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  0123456789ABCDEF
//--------  -----------------------------------------------  ----------------
//00000000  43 6F 64 65                                      Code

As you’ve seen in this article, ConvertUtilities can be very useful for .Net developers.

Happy Converting!

The R&D Team

Target Name Transformation aka TNT

October 10, 2014 Leave a comment

CodeFluent Entities allows you to write RAW methods. Using the name of a table or a column in a RAW method is not safe. Indeed CodeFluent Entities allows to define its own naming convention. So if you write the name of a column in a raw method and then you change the naming convention of your project, your method won’t work anymore.

To handle this case, CodeFluent Entities introduce Target Name Transformation (aka TNT). In a Raw method you can refers to a column by using for example “$Customer::DateOfBirth$”. This will be replaced by CodeFluent Entities by the name of the column corresponding to the property “DateOfBirth” of the entity “Customer”.

TNT supports the following syntaxes:

  • $[EntityName]$ corresponds to the table name,
  • $[PropertyName]$ corresponds to the property name,
  • $[EntityName]::[PropertyName]$ corresponds to the column name,
  • $[EntityName]:[ViewName]$ corresponds to the view name,
  • $[EntityName]:[ViewName]:[PropertyName]$ corresponds to a column name in the defined view,
  • $[Namespace].[EnumerationName].[EnumerationValue]$ corresponds to the enumeration value of an enumeration declared in the model.

We already talk about all of this. So today I’ll show you more.

When you write “$[EntityName]::[PropertyName]$”, CodeFluent Entities find the property and write its persistence name. But you can also specify a format by using curly brackets. Format allows you to navigate in the CodeFluent Entities API and get the desired value. Here’s some examples:

$Customer{Columns}$

[Customer].[Customer_Id],[Customer].[Customer_Name],[Customer].[Customer_DateOfBirth],
[Customer].[_trackLastWriteTime],[Customer].[_trackCreationTime],
[Customer].[_trackLastWriteUser],[Customer].[_trackCreationUser],
[Customer].[_rowVersion] 

$Customer:CustomView{Columns}$

[vCustomerCustomView].[Customer_Id],[vCustomerCustomView].[Customer_Name],
[vCustomerCustomView].[_rowVersion],[vCustomerCustomView].[_trackCreationTime],
[vCustomerCustomView].[_trackLastWriteTime],[vCustomerCustomView].[_trackCreationUser],
[vCustomerCustomView].[_trackLastWriteUser]

$Customer{TrackCreationUserColumn.FullName}$

[Customer].[_trackCreationUser]

$Customer{TrackLastWriteUserColumn.FullName}$

[Customer].[_trackLastWriteUser]

$Customer{TrackCreationTimeColumn.FullName}$

[Customer].[_trackCreationTime]

$Customer{TrackLastWriteTimeColumn.FullName}$

[Customer].[_trackLastWriteTime]

$Customer{RowVersionColumn.FullName}$

[Customer].[_rowVersion]

$Customer{TypeNameColumn.FullName}$

[Customer].[_typeName]

$Customer{Schema}$

Sample

$Customer{Entity.Properties.Count}$

3

$Customer{Columns[0].Name}$

Customer_Id

$Customer{Entity.Properties[“Name”].Column.Name}$

Customer_Name

$FirstName{Name}$

FirstName

$Customer::Name{DefaultValue}$

John Doe

$Customer::Id{FullPersistenceName}$

[Customer].[Customer_Id]

$Customer:CustomView:FirstName{Expression}$

FirstName

$Customer{Procedures[“Customer_Load”].FullName}$

[Customer_Load]

To find all possible formats, open Visual Studio Object Browser (Menu / View / Object Browser), and add “C:\Program Files (x86)\SoftFluent\CodeFluent\Modeler\CodeFluent.Model.dll” and look at properties of classes:

  • CodeFluent.Model.Persistence.Table
  • CodeFluent.Model.Property
  • CodeFluent.Model.Persistence.View
  • CodeFluent.Model.ViewProperty
  • CodeFluent.Model.Enumeration
  • CodeFluent.Model.EnumerationValue

If you can’t figure how to get a specific information from your model, please ask your question on the forum.

Happy TNTing,

The R&D Team

Follow

Get every new post delivered to your Inbox.

Join 52 other followers