5

I am really impressed with CompositeC1 and the ability to add data types on the fly, reference other data types with a foreign key relationship, etc. The built in functions are also really handy.

Ideally, I could create a separate Web API project that would be able to use all of the functions that are generated on the fly in CompositeC1 and expose them out as REST services.

Should I do this as a separate project referencing the dll's in CompositeC1's bin directory? Those dll's are regenerated each time a custom data type is altered... would that cause an issue?

user529794
  • 115
  • 6
  • In case anyone is looking to add Web API directly inside the project, this link will help you: http://blogs.msdn.com/b/henrikn/archive/2012/02/23/using-asp-net-web-api-with-asp-net-web-forms.aspx – user529794 Jun 21 '13 at 12:03
  • About the DLLs in the bin directory. Composite.Generated.dll hold the interface definitions you create in the C1 Console. You can reference this DLL fairly safely, but you can also make the interfaces using C#. See http://docs.composite.net/Console/Static-IData-Types and http://www.composite.net/Add-on-Market/Packages/Composite.Tools.StaticDataTypeCreator. Tip: always have "copy local" set to false for Composite.generated.dll – mawtex Jun 25 '13 at 23:33

1 Answers1

5

I just wrote a post tonight that I think answer the question.

http://www.s-innovations.dk/Blog/2013/06/25/Mobile-Services-for-Composite-C1--Idea-Creation

I make an API by tapping into the C1 System and get my data from there. No need to worry about dlls being generated and such.

But you can create your own API in a seperate dll also. You can see from my post the basic steps of getting an API up and running.

You could get a problem if you make a WebAPI that exposes something that a user deletes in the console, then your dll breaks? The idea with my project is to make it dynamic expose types configured from within the console. So if someone deletes a type, then it also get removed from my API.

Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283
  • Hi Poul. That work really looks great. Are you willing to provide the source? I'm sure lots would love to play with it. Also, selfishly, I'm going to select a CMS for a new work project my team in taking on and will be deciding this weekend on the platform. Right now it is between Composite C1 and Umbraco. Source for this work may swing the scales over to Composite C1. Thanks. – RobM Aug 31 '13 at 01:35
  • I only have those snippets that I show in the blog post at this point. Theres not much more into it than register the api route, create a few controllers and expose data from C1. You can copy the snippets from gist if you want them :) I am in the process of creating a project that takes the parts I am showing the blog post and putting it together in a usable way. I will share in a few weeks time. Short story, I lost my laptop and dint save the source code of the project as I was just hacking a little around. – Poul K. Sørensen Sep 01 '13 at 18:12
  • Ok, thanks Poul. Very sorry to hear about the laptop. Thanks for the reply. Would be great if you can include an update here too (in addition to your blog) once you put together the project. I'm sure I (and others) could figure it out -- but still just coming up to speed on Composite C1 in the first place. What you have in binary provides 80%-90% solution (for my needs). I just need the source so that I know that my team could fix it if/as necessary. In any event, thanks for the work -- it will REALLY be a GREAT addition to Composite C1, as that is the missing ingredient right now (for me). – RobM Sep 03 '13 at 04:40
  • What I have done right now when creating my package was to decompile my old dll and took the parts i needed. You can do the same. Take the dll from my package. – Poul K. Sørensen Sep 04 '13 at 10:37
  • First : Your website seems down. Second : You should always put some of the source that answers the question in case the website you are refering to is not accessible (which is the case right now) – RPDeshaies Mar 04 '15 at 19:53
  • @Tareck117 Thanks for notifying. Will resolve it in the weekend. – Poul K. Sørensen Mar 05 '15 at 12:27