Welcome to the Silverdawn Software Community

With the below box you can type your question to see if it has already been answered. 


Otherwise, you can submit your question for us to help you with.


If you wish to keep the communication private just click the "leave us a private message" link or email us at "support@silverdawnsoftware.com"


We looking forward to hearing from you

The Silverdawn Software Team

.

0
Under review

silverlight model has stopped working

David 6 years ago updated by daniel 6 years ago 5

I am trying to run the sofware after installation but it keep sayin  silverlight model has stopped working

how do i fix this 

0
Will be answered

I'm trying to debug a function in razor, is there any way to view the variable values?

Albert Gardner 7 years ago updated by daniel 7 years ago 1

Hi,

I am trying to debug a function in razor, but am having difficulties in seeing the values of variables in it. 

I am trying to see the values of the lookupfield metadata.

My function is as follows


 public static string GetLookupFieldName(IClassifier umlClass)
{
        foreach (var att in umlClass.Attributes())
        {
            if (att["Database Functions","LookupField"]=="True")
            {
                return att.Name;
            }
        }        
        return "";
    }

Can you help?

Answer
daniel 7 years ago

What you want to do is add the Output object to your function. 

You can do it like this


public static string GetLookupFieldName(IClassifier umlClass, IOutput output)

Then you can output values to "Output" window in SilverModel.

output.WriteLine(att["Database Functions","LookupField"]);

The above line will output the value of the metadata to the output window.


Hope this helps, let me know if you need more information.

0
Planned

Is there a command line option to generate code?

Duncan Walls 7 years ago updated by daniel 7 years ago 1

Is it possible to generate code from the command line so we can integrate this into our build process?

We are doing this manually but would like to automate the process.

0
Answered

Can you output SQL

Warren Peace 7 years ago updated by daniel 7 years ago 1

I need my project to create SQL code for SQL server was well. Its it possible to create the code for stored procedures with SilverModel?



Answer
daniel 7 years ago

Hi Warren.


Yes, SilverModel can easily generate the code for stored procedures for you.


Have a look at the POCO generator for C# https://github.com/SilverdawnSoftware/SilverModel-Code-Generators/blob/master/Microsoft/General/C%23%20Poco/pocoStart.razor . This template could be easy modified to create SQL code for you.


If you need anymore help please ask.


0
Answered

How do you to find out what a classes a class is inheriting from

Albert Friedman 7 years ago updated by daniel 7 years ago 2

Hi,


I am creating a code generator for my model and I am trying to work out if the current class is inheriting from another class?


Whats the best API call to use?


Cheers

Albert


Answer
daniel 7 years ago

Hi Albert,


To find out what classes and class in inheriting, you will need to find the Generalizations for that class, where that class is the target. 


There is an method called GetTargetGeneralizations that will allow you to find these.



I have updated the EF Core Generator to support this. See the file DatabaseObject.razor for an example.


Also here is a copy of the relevant code.




public static string GetInheritance(IClassifier umlClass)
{

var generals=umlClass.GetTargetGeneralizations();

if (generals.Any())
{
return ": "+((INamedElement)generals.First().Source).Name;
}

return "";
}

Hope this helps, any more questions please ask me.