Skip to content
Snippets Groups Projects
Commit 2f7e1c05 authored by areynold's avatar areynold
Browse files

copy class files and readme from api solution

remove v2 objects
parent 6aa877bd
No related branches found
No related tags found
No related merge requests found
# API Data Transfer Objects
This project contains data transfer objects (complex model classes) corresponding to the Beckman Comms API output.
The DTO project should be repackaged and published with each update to the `Api.DataTransferObjects` assembly.
## NuGet Packaging Instructions
0. Install [NuGet Package Explorer](https://chocolatey.org/packages/NugetPackageExplorer).
1. Open `Api.DataTransferObjects.nuspec` in NuGet Package Explorer.
* Expand the **lib** tree in the **Package Contents** pane.
2. Open the `Api.DataTransferObjects\bin` directory in file explorer.
3. In Visual Studio, clean the solution in both Debug and Release modes.
4. In Visual Studio, build the solution in both Debug and Release modes.
5. Drag the `.dll`, `.pdb`, and `.xml` objects from the Debug and Release folders in file explore to their respective directories in the NuGet File Explorer **Package Contents** pane.
6. In the **Package Metadata** pane of NuGet Package Explorer, click the icon to edit package metadata.
* Increment the **Version** field using [semantic versioning](http://semver.org/).
* Summarize version changes in the **Release Notes** field.
* Update package dependencies if needed.
7. Save Metadata (**File > Save Metadata As...**) `Api.DataTransferObjects.nuspec` in the Api.DataTransferObjects project folder and commit to version control.
8. Save package (**File > Save As...**) `G:\External Relations\CommsInternalNuGetFeed\Api.DataTransferObjects.{version}`.
### Resources
* [How to host your own NuGet Server and Package Feed](https://www.hanselman.com/blog/HowToHostYourOwnNuGetServerAndPackageFeed.aspx)
* [Publish your .Net library as a NuGet package](http://twistedoakstudios.com/blog/Post1295_publish-your-net-library-as-a-nuget-package)
* [Creating a local NuGet repository with dependencies bundles](http://www.marcusoft.net/2011/09/creating-local-nuget-repository-with.html)
## Using the NuGet Package
0. In Visual Studio, open your NuGet package sources config (**Tools > Options > NuGet Package Manager > Package Sources**).
1. Click the **+** icon to add a new source with default settings.
* In the **Name** field, give the feed a meaningful name (e.g., "Beckman Internal Feed").
* Use the **...** icon next to the **Source** field to browse to `G:\External Relations\CommsInternalNuGetFeed`.
2. Click **Update**.
3. Click **OK**.
4. Search and install NuGet packages as usual.
\ No newline at end of file
using System;
using System.Xml.Serialization;
namespace Api.DataTransferObjects.V1
{
/// <summary>
/// Data Transfer Object representing a Beckman news article.
/// </summary>
[XmlType(TypeName = "Article")]
public class FeedArticleDTO
{
/// <summary>
/// Article title.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Article author's name.
/// </summary>
public string Author { get; set; }
/// <summary>
/// Article URL.
/// </summary>
public string Link { get; set; }
/// <summary>
/// Article description.
/// </summary>
public string Description { get; set; }
/// <summary>
/// Date the article was published.
/// </summary>
public DateTime PublishDate { get; set; }
/// <summary>
/// Flag indicating whether the article is hosted on a Beckman server.
/// </summary>
public bool IsInternal { get; set; }
}
}
\ No newline at end of file
using System;
using System.Xml.Serialization;
namespace Api.DataTransferObjects.V1
{
/// <summary>
/// Data Transfer Object representing a Beckman Cafe menu.
/// </summary>
[XmlType(TypeName = "CafeMenu")]
public class FeedCafeMenuDTO
{
/// <summary>
/// Menu title.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Menu date.
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// Menu items.
/// </summary>
public string Description { get; set; }
}
}
\ No newline at end of file
using System;
using System.Xml.Serialization;
namespace Api.DataTransferObjects.V1
{
/// <summary>
/// Data Transfer Object representing a Beckman event.
/// </summary>
[XmlType(TypeName = "Event")]
public class FeedEventDTO
{
/// <summary>
/// Event name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Room number in the Beckman building.
/// </summary>
public string RoomNumber { get; set; }
/// <summary>
/// Date and time of event.
/// </summary>
public DateTime DateTime { get; set; }
/// <summary>
/// Event date.
/// </summary>
public DateTime Date { get; set; }
}
}
\ No newline at end of file
using System.Xml.Serialization;
namespace Api.DataTransferObjects.V1
{
/// <summary>
/// Data Transfer Object representing a Beckman Institute staff member.
/// </summary>
[XmlType(TypeName = "Person")]
public class FeedPersonDTO
{
/// <summary>
/// Person's unique ID number.
/// </summary>
public long PersonId { get; set; }
/// <summary>
/// Person's full name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Person's Beckman title.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Person's campus address.
/// </summary>
public string BuildingAddress { get; set; }
/// <summary>
/// Person's campus email address.
/// </summary>
public string EmailAddress { get; set; }
/// <summary>
/// Person's room number in the Beckman Institute.
/// </summary>
public string RoomNumber { get; set; }
/// <summary>
/// Person's campus phone number.
/// </summary>
public string PhoneNumber { get; set; }
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment