Microsoft Graph API basic app in C# - c#

I want to develop a basic C# application that makes use of Microsoft Graph API to retrieve all user emails and contacts.
How would I approach this to implement it from scratch on Visual Studio?
I tried to add a method to do so in the provided sample, without success.

You can start with some of the QuickStarts
https://developer.microsoft.com/en-us/graph/quick-start
For example, you start with ASP.NET MVC quickstart and then expand it with additional controllers that would handle listing emails and contacts.
There is quite good SDK for .NET that you can use in your apps - it will make your development easier. The SDK enables you to write quite nice async calls instead of calling the API directly and composing your REST queries.
For example, to retrieve messages in user's mailbox you would make a call like
graphServiceClient.Me.Messages.Request().GetAsync();
It might be helpful to take some ideas from my demo app that I use for conferences - it is based on some Graph Labs
https://github.com/panjkov/Office365PlannerTask
Take a look at Groups and Tasks controllers, as well as corresponding data repository classes - there are methods to retrieve particular collections, as well to retrieve specific items.

Related

Licensing Asp.Net application with Portable.Licensing

I need to protect an Asp.Net Web Api 2.2 application using Portable.Licensing.
I have organized the application by creating multiple Asp.Net Areas.
Ex:
Core
Accounting
Human Resource
Inventory
I need to licence each and every Areas. If customer has purchased the Accounting module, then only he should be able to access the Accounting functionality. Otherwise I have to display an error message.
And also I would like to generate a unlike machine key to protect software from piracy.
So how can I use portable licensing with Asp.Net Areas?
Where/At which point the license needs to be validated?
Could any one please help me to achieve my requirement by providing some instructions?
Providing sample code is highly appreciated!.
For everyone wandering about same thing:
Well, basically, how to implement licensing in your application - it depends! No silver bullet, as always.
I spent half of a day studying Portable.Licensing and that's what comes into my mind:
In Portable.Licensing you have "WithProductFeatures" method in fluent api for adding custom data to license, and your Areas is just it - product features. But where to insert check for it - depends on number of factors:
How much do you care for solution performance?
How much do you care for people just cracking IL?
If you care more about performance then about people changing assemblies easily and getting cracked version - you can save Available Feature data from license to some cache and access it in:
Every method of WebApi controller
Basic controller for your WebApi Controllers (OnActionExecuting is a good candidate)
In Filter for WebApi (here is some nice example)
And if you consider trying harder to protect your code - spread license data checking calls across these places, and add them using Fody (i am just planning on implementing it, so no code sample - just library reference here) - don't make life of pirates as easy as changing IL of 1 method :)

Typo3 C# interface (SOAP or REST)

I've got the task to connect a platform based on .net via a plugin to Typo3. I'm not very familiar with Typo3, but with the .net stack (actually using C#).
The requirements include writing data to Typo3 and retrieving data from Typo3.
Looking at the Typo3 API documentation (http://api.typo3.org/), I don't find any information on the interfaces I could use, or even how to stuff data into the system. I used all my favorite search engines, but ended up here. (Or I just searched for the wrong terms?!)
Following requirements have been provided additionally:
No writing/reading to/from the database (we don't get access to it for multiple reasons)
Use of a general solution (which could be re-used for different entities)
Synchronous process (so we get an error when inserting data has failed, etc.)
No batch import/export solution
Authentication must be used
What I search for is a simple interface which I can consume from my plugin. Something like SOAP, REST or any variant which I can call via http/https - including authentication.
Do you have an idea?
There is no external API built in TYPO3 out of the box.
Quick search for REST or SOAP based extensions (http://typo3.org/extensions/repository/) to provide e.g. page structure and contents from TYPO3 doesn't provide any results either.
The only solution is to write an own extension providing a SOAP or REST API to access TYPO3 data.

Integrating DISQUS into a Windows 8 app

Has anyone tried to integrate DISQUS into a Windows 8 store app? Or do we need to build around the DISQUS API?
We have an existing blog site that uses DISQUS and I'm currently building a Win8 app in XAML+C# that displays the same blog items (and have the comments functionality as well).
We haven't released this officially yet, but there's a public API wrapper that is compatible with Windows Store apps here: https://github.com/ryanvalentin/DisqusApiPortable
In general, there are a few things to think about when creating a commenting experience:
Authentication with the API - you need to have a server to receive the callback/request the access token. More information on that here: http://disqus.com/api/docs/auth/
Listing comments. The main limitation here is that there's no public API endpoint for showing threaded comments like you see in the embedded product. You would have to show a flat list of comments instead, sorted either oldest or newest.
Posting comments. This requires some care to make the experience pleasurable, including proper communication when a user encounters errors.
Additionally you can add comment voting, thread favoriting and almost anything else using the public API. This documentation covers general API usage that the wrapper enables: http://help.disqus.com/customer/portal/articles/1104798
Lastly, you might consider using a web view control to load the standard Disqus javascript embed. For that I'd follow these instructions: http://help.disqus.com/customer/portal/articles/472096

Magento API - Link simple product to configurable product

I'm writing a middleware solution which should be able to take products from a specific source and add/update these to/in Magento.
Since there are products with different sizes/colors/etc I'll need to make use of Magento's configurable and simple products.
Adding the products does not expose a problem, linking a simple product to a configurable one however does.
Does anyone know how to accomplish this using the API?
I'm using C# and the v2 SOAP Magento API.
Using custom PHP code or CSV imports is not a possibility.
Thanks in advance!
This is not achivable via Standart API.
You should write your own.
We had project where we wrote Configurable API and other Company Java warehouse connector.
So you can try to directly access DB. Or try to find some module.
In Magento you can extend their API, either directly in the php code, or via a magento extension(preferred approach, as it allows you to upgrade magento). Neither of these approaches requires hitting the database directly. Rather you are using the serverside php api (lots of examples on the magento site) and using the php object/entity model and methods to do that.
Specifically the call that you're looking for in the product API is called getAssociatedProducts() This call is NOT availble in the webservices API, but you can call it via an extension that you write and make it available in the through the webservice API that way.
Alternatively you can get ALL of the products with attributes and try to link the association between configurables/simples that way, but that approach will obviously be much slower than the extension route.

Difference in Sharepoint and .Net development?

What is difference in developing applications using .Net Framework, Asp.net and developing application in Sharepoint (MOSS or WSS)?
Sharepoint is a collaboration tool built on top of .NET and ASP.NET. To develop applications for Sharepoint means you still need familiarity with ASP.NET and the .NET Framework, but also familiarity with the Sharepoint infrastructure/API's.
I highly recommend checking out this thread for various pain points:
https://stackoverflow.com/questions/256407
Since SharePoint is built on ASP.NET, the argument can be made that anything you can do with ASP.NET you can do with SharePoint but the reality is developing applications for SharePoint is not for the faint-hearted and you should expect a much longer development cycle, particularly if you are new to the platform. I suggest becoming very familiar with Google, StackOverflow, and .NET Reflector because a lot of what you need to know is not in the documentation or hard to find.
It's not all bad though. You get a lot of infrastructure out of the box like authentication, versioning of data (if you are storing your data in lists), and incoming/outgoing email connectivity to name a few.
Depends on what sort of stuff you want to do really. There are many points in SharePoint that are exposed for you to build on. For simple requirements one of these points of development will suffice but for typical business applications on SharePoint you use a combination of features such as workflow, event receivers, timer jobs, web parts, sites and lists. C# code can run in a workflow, an event reciever, the code-behind library attached to an infopath form.
Essencially SharePoint gives you a collaboration platform to develop on to enable all sorts of things. Be warned thou, it certainly isn't as painless as straight C# development and requires lots of technologies and thus lots of new learning. However it's a been a very rewarding experience for me.
SharePoint is working with canned but modifiable website templates (WSPs) inside a of an system with a really long feature list-- including an abstraction over the data store (lists), the templating engine, work flow features, etc, etc.
The other is custom development of websites from scratch.
You can have it both ways. SharePoint itself was build with ASP.NET 2.0, so you can host aspx and with some effort ascx pages inside of SharePoint. Once inside SharePoint, any custom written .NET code can take advantage of the SharePoint object model. This works best if a custom application from the start is planned to be hosted in SharePoint.
Deploying your solution. SharePoint uses WSP files while ASP.Net supports copy/paste.
Think of SharePoint as a framework that sits on top of ASP.Net. There are rules to use this framework, try your best to abide by the rules.

Categories

Resources