locked
I received these specs and I trying convert document requirements to C# RRS feed

  • Question

  • User-858033455 posted

    Method Name

    Description

    NewItem

    Generate a Initialized object

     

    Direction

    Parameter

     

    Input

    None

     

    Output

    Object

    Method Name

    Description

    Get

    Retrieve a constructed object meeting the input specified

     

    Direction

    Parameter

     

    Input

    Id (string)

     

    Output

    Object

     

    Method Name

    Description

    Save

    Create new object or update existing object returning the results that were saved

     

    Direction

    Parameter

     

    Input

    Object

     

    Output

    Object

     

    Method Name

    Description

    Delete

    Remove object from use

     

    Direction

    Parameter

     

    Input

    Id (string)

     

    Output

    None

     

    Method Name

    Description

    GetHistory

    Retrieve a constructed collection of object meeting the input specified

     

    Direction

    Parameter

     

    Input

    Id (string)

     

    Output

    object (Array)

    My code is this.

    using System.Collections.Generic;
    using System.ServiceModel;
    
    namespace 
    {
        // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "Object" in both code and config file together.
        [ServiceContract]
        public interface IObject
        {
            [OperationContract]
            void NewItem();
    
            [OperationContract]
            string Get(string Id);
    
            [OperationContract]
            Object Save(object Id, object saved );
    
            [OperationContract]
            void Delete(string Id);
    
            [OperationContract]
            List<Object> GetHistory(string Id, List<object> meeting);
    
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    
    
    namespace 
    {
        // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "object" in code, svc and config file together.
        // NOTE: In order to launch WCF Test Client for testing this service, please select object.svc or object.svc.cs at the Solution Explorer and start debugging.
        public class Object : IObject
        {
            public void NewItem()
            {
                throw new NotImplementedException();
            }
    
            public string Get(string trailerId)
            {
                return Id;
            }
    
            public object Save(Id, trailer)
            {
                return trailer;
            }
          
          
            public void Delete(string Id)
            {
                throw new NotImplementedException();
            }
    
            public List<object> GetHistory(string trailerId, List<object> meeting)
            {
                return meeting.Select(history => history).ToList();
            }
        }
    }
    


    This is a template layout If not correct what do I need to change. Thanks.

    Thursday, January 8, 2015 9:30 AM

Answers

  • User-858033455 posted

    Thanks I figured it out.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 8, 2015 11:24 AM