MetadataException: Unable to load the specified metadata resource

C#.NetEntity Frameworkado.net

C# Problem Overview


All of a sudden I keep getting a MetadataException on instantiating my generated ObjectContext class. The connection string in App.Config looks correct - hasn't changed since last it worked - and I've tried regenerating a new model (edmx-file) from the underlying database with no change.

Anyone have any ideas?

Further details: I haven't changed any properties, I haven't changed the name of any output assemblies, I haven't tried to embed the EDMX in the assembly. I've merely waited 10 hours from leaving work until I got back. And then it wasn't working anymore.

I've tried recreating the EDMX. I've tried recreating the project. I've even tried recreating the database, from scratch. No luck, whatsoever.

C# Solutions


Solution 1 - C#

This means that the application is unable to load the EDMX. There are several things which can cause this.

  • You might have changed the MetadataArtifactProcessing property of the model to Copy to Output Directory.
  • The connection string could be wrong. I know you say you haven't changed it, but if you have changed other things (say, the name of an assembly), it could still be wrong.
  • You might be using a post-compile task to embed the EDMX in the assembly, which is no longer working for some reason.

In short, there is not really enough detail in your question to give an accurate answer, but hopefully these ideas should get you on the right track.

Update: I've written a blog post with more complete steps for troubleshooting.

Solution 2 - C#

A minor amendment helped me with this problem.

I had a solution with 3 project references:

connectionString="metadata=res://*/Model.Project.csdl|res://*/Model.Project.ssdl|res://*/Model.Project.msl;

which I changed to:

connectionString="metadata=res://*/;

Solution 3 - C#

You can get this exception when the Edmx is in one project and you are using it from another.

The reason is Res://*/ is a uri which points to resources in the CURRENT assembly. If the Edm is defined in a different assembly from the code which is using it, res://*/ is not going to work because the resource cannot be found.

Instead of specifying ‘*’, you need to provide the full name of the assembly instead (including public key token). Eg:

res://YourDataAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abcdefabcedf/YourEdmxFileName.csdl|res://...

A better way to construct connection strings is with EntityConnectionStringBuilder:

public static string GetSqlCeConnectionString(string fileName)
{
    var csBuilder = new EntityConnectionStringBuilder();

    csBuilder.Provider = "System.Data.SqlServerCe.3.5";
    csBuilder.ProviderConnectionString = string.Format("Data Source={0};", fileName);

    csBuilder.Metadata = string.Format("res://{0}/YourEdmxFileName.csdl|res://{0}/YourEdmxFileName.ssdl|res://{0}/YourEdmxFileName.msl", 
        typeof(YourObjectContextType).Assembly.FullName);

    return csBuilder.ToString();
}

public static string GetSqlConnectionString(string serverName, string databaseName)
{
    SqlConnectionStringBuilder providerCs = new SqlConnectionStringBuilder();

    providerCs.DataSource = serverName;
    providerCs.InitialCatalog = databaseName;
    providerCs.IntegratedSecurity = true;

    var csBuilder = new EntityConnectionStringBuilder();

    csBuilder.Provider = "System.Data.SqlClient";
    csBuilder.ProviderConnectionString = providerCs.ToString();

    csBuilder.Metadata = string.Format("res://{0}/YourEdmxFileName.csdl|res://{0}/YourEdmxFileName.ssdl|res://{0}/YourEdmxFileName.msl",
        typeof(YourObjectContextType).Assembly.FullName);

    return csBuilder.ToString();
}

If you still encounter the exception, open the assembly in reflector and check the filenames for your .csdl, .ssdl and .msl files. When the resources have different names to the ones specified in the metadata value, it’s not going to work.

Solution 4 - C#

I had a similar error. I had recreated the project (long story), and pulled everything over from the old project. I hadn't realized that my model had been in a directory called 'Model' before, and was now in a directory called 'Models'. Once I changed the connection in my Web.Config from this:

<add name="RecipeManagerEntities" connectionString="metadata=res://*/Model.Recipe.csdl 

to this:

<add name="RecipeManagerEntities" connectionString="metadata=res://*/Models.Recipe.csdl

Everything worked (changed Model to Models). Note that I had to change this three places in this string.

Solution 5 - C#

And a quick way to check the model name without Reflector.... look for the directory

>...obj/{config output}/edmxResourcesToEmbed

and check that the .csdl, .msl, and .ssdl resource files are there. If they are in a sub-directory, the name of the sub-directory must be prepended to the model name.

For example, my three resource files are in a sub-directory Data, so my connection string had to be

>metadata=res://*/Data.MyModel.csdl|res://*/Data.MyModel.ssdl|res://*/Data.MyModel.msl;

(versus metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;).

Solution 6 - C#

I also had this problem and it was because the connectionstring in my web.config was slightly different than the one in the app.config of the assembly where my EDMX is located. No idea why it changed, but here are the two different versions.

App.config:

<add name="SCMSEntities" connectionString="metadata=res://*/Model.SMCSModel.csdl|res://*/Model.SMCSModel.ssdl|res://*/Model.SMCSModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SANDIEGO\sql2008;initial catalog=SCMS;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Web.config:

<add name="SCMSEntities" connectionString="metadata=res://*/Model.SCMSModel.csdl|res://*/Model.SCMSModel.ssdl|res://*/Model.SCMSModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SANDIEGO\sql2008;initial catalog=SCMS;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

What fixed it was simply copying the app.config string (notice the small difference at the end - instead of "App=EntityFramework" it wanted "application name=EntityFramework") into the web.config and problem was solved. :)

Solution 7 - C#

This happens to me when I do not clean solution before build new .edmx designer. So just don’t forget to clean solution before you build new .edmx designer. This helps me to skip lot more issues with this one. Bellow the navigation details provided incase you are new in visual studio.

> Click->Build->Clean Solution > > Then Click->Build->Rebuild Solution

Hope this helps. Thanks everyone

Solution 8 - C#

This happened to me when I accidentally switched the Build Action of the edmx file (appears under Properties in the IDE) from 'EntityDeploy' to 'None'. EntityDeploy is what populates the metadata for you: see http://msdn.microsoft.com/en-us/library/cc982037.aspx

Solution 9 - C#

If you are using the edmx from a different project, then in the connection string, change...

metadata=res://*/Data.DataModel.csdl

...to...

metadata=res://*/DataModel.csdl

Solution 10 - C#

I've just spent a happy 30 minutes with this. I'd renamed the entities object, renamed the entry in the config file, but there's more ... you have to change the reference to the csdl as well

very easy to miss - if you're renaming, make sure you get everything ....

Solution 11 - C#

I had the same problem. I looked into my complied dll with reflector and have seen that the name of the resource was not right. I renamed and it looks fine now.

Solution 12 - C#

For my case, it is solved by changing the properties of edmx file.

  1. Open the edmx file
  2. Right click on any place of the EDMX designer
  3. choose properties
  4. update Property called "Metadata Artifact Processing" to "Embed in Output Assembly"

this solved the problem for me. The problem is, when the container try to find the meta data, it cant find it. so simply make it in the same assembly. this solution will not work if you have your edmx files in another assembly

Solution 13 - C#

I spent a whole day on this error

if you are working with n-tear architecture

or you tried to separate Models generated by EDMX form DataAccessLayer to DomainModelLayer

maybe you will get this error

  1. First troubleshooting step is to make sure the Connection string in webconfig (UILayer)and appconfig (DataAccessLayer) are the same

  2. Second which is Very important the connection string

    connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provid.....
    

which is the problem

from where on earth I got Modelor whatever .csdl in my connection string where are they

here I our solution look at the picture

enter image description here

hope the help you

Solution 14 - C#

Sometimes i see this error in my project. I solve that by

1 - Right click on EDMX file

2 - Select Run Custom Tool option

3 - Rebuild project

Solution 15 - C#

I was able to resolve this in Visual Studio 2010, VB.net (ASP.NET) 4.0.

During the entity model wizard, you will be able to see the entity connection string. From there you can copy and paste into your connection string.

The only thing I was missing was the "App_Code." in the connections string.

entityBuilder.Metadata = "res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl"

Solution 16 - C#

After hours of googling and trying to solve none of the solutions suggested worked. I have listed several solution here. I have also noted the one that worked for me. (I was using EF version 6.1.1, and SQL server 2014 - but an older DB)

  1. Rebuilding the project and try again.
  2. Close and open VS - I don't know how this works
  3. make sure if you have placed the .EDMX file inside a Directory, make sure you include the Directories in your ConnectionString. for example mine is inside DAL folder. SO it looks like this: connectionString="metadata=res://*/DAL.nameModel.csdl|res://*/DAL.nameModel.ssdl|res://*/DAL.nameModel.msl;(these are files. to see them you can toggle Show All Files in solution explorer, under ~/obj/.. directory)

...and many more which I had tried [like: reverting the EntityFramework version to a later version(not sure about it)]


what worked for me:

from this article here, it helped me solve my problem. I just changed my ProviderManifestToken="2012" to ProviderManifestToken="2008" in the EDMX file. To do this:

Solution Explorer

  1. Right click over file .edmx
  2. Open with..
  3. Editor XML
  4. Change ProviderManifestToken="XXXX" with 2008

I hope that helps.

Solution 17 - C#

The ultimate solution (even after recreating the database on two other machines, as well as the EDMX and other sundries) was to not use the first edition of Entity Framework. Looking forward to evaluating it again in .NET 4.0.

After running into the same problem again and searching all over for an answer, I finally found someone who'd had the same problem. It appears that the connection string wasn't correctly generated by Visual Studio's wizard, and the link to the metadata resources was missing an important path.

v1.0 BUG?: Unable to load the specified metadata resource. Scripts != Models

Update 2013-01-16: Having transitioned to almost exclusively using EF Code First practices (even with existing databases) this problem is no longer an issue. For me, that was a viable solution to reducing the clutter from auto-generated code and configuration and increasing my own control over the product.

Solution 18 - C#

In my case, this issue was related to renaming my model's edmx file... correcting the app.config connection string for the csdl/ssdl/msl files fixed my issue.

If you're using the EF 4.0 designer to generate your csdl/ssdl/msl, these 3 "files" will actually be stored within the model's main edmx file. In this case, the post by Waqas is pretty much on the mark. It's important to understand that "Model_Name" in his example will need to be changed to whatever the current name of your model's .edmx file (without the .edmx).

Also, if your edmx file is not at the root level of your project, you need to preface Model_Name with the relative path, e.g.

res://*/MyModel.WidgetModel.csdl|res://*/MyModel.WidgetModel.ssdl|res://*/MyModel.WidgetModel.msl

would specify the csdl/ssdl/msl xml is stored in the model file 'WidgetModel.edmx' which is stored in a folder named 'MyModel'.

Solution 19 - C#

My issue and solution, the symptoms were the same "Unable to load the specified metadata resource" but the root cause was different. I had 2 projects in solution one was the EntityModel and the other the solution. I actually deleted and recreated the EDMX file in the EntityModel.

The solution was that I had to go back to the Web Application project and add this line into the config file. The new model had changed a few items which had to be duplicated in the "other" project's Web.Config file. The old configuration was no longer good.

     <add name="MyEntities"
     connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
                    provider=System.Data.SqlClient;
                    provider connection string=&quot;
                    data source=Q\DEV15;initial catalog=whatever;
                    user id=myuserid;password=mypassword;
                    multipleactiveresultsets=True;
                    application name=EntityFramework&quot;"
     providerName="System.Data.EntityClient" />

Solution 20 - C#

I have written this helper class to create instances of ObjectContext objects when they are defined in a different project than the project using it. I parse the connection string in the config file and replace '*' by the full assembly name.

It is not perfect because it uses reflection to build the object, but it is the most generic way of doing it that I could find.

Hope it helps someone.

public static class EntityHelper<T> where T : ObjectContext
{
    public static T CreateInstance()
    {
        // get the connection string from config file
        string connectionString = ConfigurationManager.ConnectionStrings[typeof(T).Name].ConnectionString;

        // parse the connection string
        var csBuilder = new EntityConnectionStringBuilder(connectionString);

        // replace * by the full name of the containing assembly
        csBuilder.Metadata = csBuilder.Metadata.Replace(
            "res://*/",
            string.Format("res://{0}/", typeof(T).Assembly.FullName));

        // return the object
        return Activator.CreateInstance(typeof(T), csBuilder.ToString()) as T;
    }
}

Solution 21 - C#

For all of you SelftrackingEntities Users , if you have followed the Microsoft Walk-through and separated the Object context class into the wcf service project (by linking to the context .tt) so this answer is for you :

part of the shown answers in this post that includes code like :

... = string.Format("res://{0}/YourEdmxFileName.csdl|res://{0}/YourEdmxFileName.ssdl|res://{0}/YourEdmxFileName.msl", 
        typeof(YourObjectContextType).Assembly.FullName); 

WILL NOT WORK FOR YOU !! the reason is that YourObjectContextType.Assembly now resides in a different Assembley (inside the wcf project assembly) ,

So you should replace YourObjectContextType.Assembly.FullName with -->

ClassTypeThatResidesInEdmProject.Assembly.FullName 

have fun.

Solution 22 - C#

Exception is because compiler pointing to non existing Metadata so just Copy app.config connectionstring to Web.config ConnectionString

Solution 23 - C#

I was having problems with this same error message. My issue was resolved by closing and re-opening Visual Studio 2010.

Solution 24 - C#

Had same issue because I renamed an assembly.

I had to also rename it in AssemblyTitle and AssemblyProduct attributes in project Properties/AssemblyInfo.cs, and also deleting and re adding the reference to the edmx file.

Then it worked just fine.

Solution 25 - C#

With having same problem I re-created edmx from Database. Solves my problem.

Solution 26 - C#

I also had the same problem and solution as per Rick, except that I was importing an existing .edmx to a new project, and while the base namespace didn't matter it was imported into a different subdirectory so I also had to update the connection string inside Web.Config in three places, to include the different subdirectory naming:

Solution 27 - C#

I had the same problem with a solution which contained projects in a Solution Folder, when they were moved to the Solution Root (in order to overcome a suspected bug with the Mvc3AppConverter due to project locations).

Although the solution compiled after all* project references were re-added as needed, the error was thrown when the website was fired up.

The EDMX is in one of the projects which was moved (the 'Data' project), but of course the lack of a reference to the Data project didn't cause a compile error, just a run-time error.

Simply adding the missing reference to the primary project resolved this problem, no need to edit the connection at all.

I hope this helps someone else.

Solution 28 - C#

As for me, I had separated Data Access Layer and User Interface layer. So I have entity connection string for each layer.

Before I modify these two separated connection strings to be the same, I still found that below error.

Unable to load the specified metadata resource

So I make to be the same connection strings for those two layers (DAL , UI), It work perfect.

My solution is to make all connection string to be the same no matter where they already presented.

Solution 29 - C#

I had this problem yesterday and was looking at my code in debug and the output from SQL Profiler.

What I couldn't understand, before I read and understood this post, was why EntityFramework was throwing this error as it was calling the DB. I was looking through hundreds of lines in SQL Profiler trying to work out what was wrong with the database model. I couldn't find anything like the call I was expecting, and to be honest I wasn't certain what I was looking for.

If you are in this position, check the connection string. My guess is that before EntityFramework creates its SQL it will check the model, specified in the metadata part of the connection string. In my case it was wrong. EntityFramework wasn't even making it as far as the DB.

Make sure the names are correct. Once I got that sorted out, I was then seeing calls in SQL Profiler where the ApplicationName was 'EntityFramework' with SQL calling the expected tables.

Solution 30 - C#

A poor app.config or web.config file can do this.. I had copied the app.config connection string to my web.config in my UI and ended up entering:

<connectionStrings>
    <connectionStrings>
          <add name="name" connectionString="normalDetails"/>
    </connectionStrings>
</connectionStrings>

Solution 31 - C#

I simply hadn't referenced my class library that contained the EDMX file.

Solution 32 - C#

Using the info from this blogpost:

Like others have said, res:\\ is a pointer to your resources. To check and make sure your resource names are correct you can use a decompiler like DotPeek by JetBrains to open up your .dll file and see your Resources files.

Or you could open up the watch window while you're debugging and paste in this code to get an array of the resource names in the currently executing assembly.

System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames()

That being said, the format of your metadata paths should be something like:

{my-assembly-name}/{possibly-a-namespace}.{class-name}.{csdl or ssdl or msl}

Solution 33 - C#

Just type path as follows instead of {Path.To.The.}: res:///{Path.To.The.}YourEdmxFileName.csdl|res:///{Path.To.The.}YourEdmxFileName.ssdl|res://*/{Path.To.The.}YourEdmxFileName.msl

Solution 34 - C#

In my case none of the answers listed worked and so I'm posting this.

For my case, building on Visual studio and running it with IIS express worked fine. But when I was deploying using Nant scripts as a stand-alone website was giving errors. I tried all the suggestions above and then realized the DLL that was generated by the nant script was much smaller than the one generated by VS. And then I realized that Nant was unable to find the .csdl, .msl and .ssdl files. So then there are really two ways to solve this issue, one is to copy the needed files after visual studio generates them and include these files in the build deployment. And then in Web.config, specify path as:

"metadata=~/bin/MyDbContext.csdl|~/bin/MyDbContext.ssdl|~/bin/MyDbContext.msl;provider=System.Data.SqlClient;...."

This is assuming you have manually copied the files into bin directory of the website which you are running. If it's in a different directory, then modify path accordingly. Second method is to execute EdmGen.exe in Nant script and generate the files and then include them as resources like done in the example below: https://github.com/qwer/budget/blob/master/nant.build

Solution 35 - C#

My theory is that if you have more than one edmx file with same name (Model1 for example), it will give that exception. I've got same problem when I decided to name all my edmx files (sitting in different projects) as Model1 because I thought they should be independent.

Solution 36 - C#

Another cause for this exception is when you include a related table in an ObjectQuery, but type in the wrong navigation property name.

Example:

var query = (from x in myDbObjectContext.Table1.Include("FKTableSpelledWrong") select x);

Solution 37 - C#

Sometimes the assembly that contains the model is not loaded:

    [TestMethod]
    public void TestOpenWithConfigurationAfterExplicit()
    {
        String dummy = typeof(MallApp).Assembly.FullName;  
        //force the assembly loaded.
        using (DbContext ctx = new DbContext("name=MyContainer))
        {
        }
    }

The type MallApp lives in the same assembly as the entity model. Without the explicit loading, an System.Data.MetadataException will be thrown.

Solution 38 - C#

When I got the metadata issue sorted out, I had a follow-on problem in the form of an invokation exception unable to find a connection string for XXXEntities in app.config (where my goal was no dependency on app.config). Through sheer luck I found that referencing System.Data in my unit test project cleared this final hurdle. So to summarise:

  1. Use nuget to install Entity Framework to your unit test project.
  2. Ensure System.Data.Entity and System.Data are referenced.
  3. Sort your connection string as described very well here.
  4. Pass the connection string to your partial class constructor.

I now have my metadata in a class library which can update from a reference db, and I can point my application and unit tests to any db on any server at runtime.

Addendum: When I moved my edmx to a folder, I got the error again. After a bit of research, I found that you want your metadata string to look like: metadata=res://EPM.DAL/Models.EPM.csdl, where EPM.DAL is the name of the assembly and EPM.edmx is in the models folder.

Solution 39 - C#

Similar problem for me. My class name was different to my file name. The connectionstring generated had the class name and not the file name in. Solution for me was just to rename my file to match the class name.

Solution 40 - C#

I got this error when my emdx file was deleted by a prebuild command, quite simply. Took me a while before realizing it was that simple.

Solution 41 - C#

In my case this was because I was building the connection string using a EntityConnectionStringBuilder. Make sure your Metadata property is using the Model name (including the namespace)

Solution 42 - C#

I got this problem after moving a large solution from one folder in Source Control Explorer to another. We don't check the package folder into Team Foundation and so I think VS downloaded packages automatically. This upgraded my EF form v6.1.2 to v6.1.3.

The problem went away when I downgraded to the original v6.1.2.

Solution 43 - C#

I had same issue on 27 Sep 2019.

My API is in Dot net core Targeting to .net framework. edmx is in a different class library which is in .net framework only.

I observed that when I try to call that edmx from API .. for some reason I got that error.

What I did is, go to the obj folder of API and delete everything. then clean the API project and try again and that worked for me.

Solution 44 - C#

I was reflecting an old program, I faced the same problem. I went through previous answers, and I succeeded to solve it by putting the 3 files of "Model.csdl", "Model.ssdl" and "Model.msl" in the bin directory, and also beside the entities class. After that change the metdata part of the entities connection string in web.config to be:

metadata=~/bin/Model.csdl|~/bin/Model.ssdl|~/bin/Model.msl

and the program ran successfully withput displaying this exception.

Solution 45 - C#

i deleted the \bin and \obj folders from all of the projects in the solution, then rebuilt the soluition and it worked fine

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJ. SteenView Question on Stackoverflow
Solution 1 - C#Craig StuntzView Answer on Stackoverflow
Solution 2 - C#MicTechView Answer on Stackoverflow
Solution 3 - C#user276695View Answer on Stackoverflow
Solution 4 - C#Rick ArthurView Answer on Stackoverflow
Solution 5 - C#leqidView Answer on Stackoverflow
Solution 6 - C#GhlouwView Answer on Stackoverflow
Solution 7 - C#Liakat HossainView Answer on Stackoverflow
Solution 8 - C#hgcummingsView Answer on Stackoverflow
Solution 9 - C#Graham LaightView Answer on Stackoverflow
Solution 10 - C#TobyEvansView Answer on Stackoverflow
Solution 11 - C#PitmingView Answer on Stackoverflow
Solution 12 - C#user464507View Answer on Stackoverflow
Solution 13 - C#Basheer AL-MOMANIView Answer on Stackoverflow
Solution 14 - C#MOH3NView Answer on Stackoverflow
Solution 15 - C#Internet EngineerView Answer on Stackoverflow
Solution 16 - C#benView Answer on Stackoverflow
Solution 17 - C#J. SteenView Answer on Stackoverflow
Solution 18 - C#JanmonView Answer on Stackoverflow
Solution 19 - C#JWPView Answer on Stackoverflow
Solution 20 - C#lauView Answer on Stackoverflow
Solution 21 - C#RobocideView Answer on Stackoverflow
Solution 22 - C#Krishna shidnekoppaView Answer on Stackoverflow
Solution 23 - C#AdamView Answer on Stackoverflow
Solution 24 - C#Antoine MeltzheimView Answer on Stackoverflow
Solution 25 - C#صفيView Answer on Stackoverflow
Solution 26 - C#eagle779View Answer on Stackoverflow
Solution 27 - C#ChrisView Answer on Stackoverflow
Solution 28 - C#Frank Myat ThuView Answer on Stackoverflow
Solution 29 - C#Daniel HollinrakeView Answer on Stackoverflow
Solution 30 - C#MyDaftQuestionsView Answer on Stackoverflow
Solution 31 - C#PeterXView Answer on Stackoverflow
Solution 32 - C#Jared BeachView Answer on Stackoverflow
Solution 33 - C#Pavel NazarovView Answer on Stackoverflow
Solution 34 - C#radkanView Answer on Stackoverflow
Solution 35 - C#alpavView Answer on Stackoverflow
Solution 36 - C#sosloView Answer on Stackoverflow
Solution 37 - C#SmartkidView Answer on Stackoverflow
Solution 38 - C#Jeff DunlopView Answer on Stackoverflow
Solution 39 - C#Rob SedgwickView Answer on Stackoverflow
Solution 40 - C#f.ciprianiView Answer on Stackoverflow
Solution 41 - C#Christopher TownsendView Answer on Stackoverflow
Solution 42 - C#RAMView Answer on Stackoverflow
Solution 43 - C#Amol AherView Answer on Stackoverflow
Solution 44 - C#Waleed.alhasanView Answer on Stackoverflow
Solution 45 - C#thehillView Answer on Stackoverflow