示例#1
0
        internal SurfSpot Create()
        {
            var surfSpot = new SurfSpot()
            {
            };

            return(surfSpot);
        }
示例#2
0
        internal SurfSpot Save(SurfSpot surfSpot)
        {
            var surfSpots = Retrieve();

            var maxId = surfSpots.Max(s => s.SpotId);
            surfSpot.SpotId = maxId + 1;
            surfSpots.Add(surfSpot);

            WriteData(surfSpots);

            return surfSpot;
        }
示例#3
0
        internal SurfSpot Save(SurfSpot surfSpot)
        {
            var surfSpots = Retrieve();

            var maxId = surfSpots.Max(s => s.SpotId);

            surfSpot.SpotId = maxId + 1;
            surfSpots.Add(surfSpot);

            WriteData(surfSpots);

            return(surfSpot);
        }
示例#4
0
        internal SurfSpot Save(int id, SurfSpot surfSpot)
        {
            var surfSpots = Retrieve();

            var itemIndex = surfSpots.FindIndex(s => s.SpotId == surfSpot.SpotId);

            if (itemIndex > 0)
            {
                surfSpots[itemIndex] = surfSpot;
            }
            else
            {
                return null;
            }

            WriteData(surfSpots);

            return surfSpot;
        }
示例#5
0
        internal SurfSpot Save(int id, SurfSpot surfSpot)
        {
            var surfSpots = Retrieve();

            var itemIndex = surfSpots.FindIndex(s => s.SpotId == surfSpot.SpotId);

            if (itemIndex > 0)
            {
                surfSpots[itemIndex] = surfSpot;
            }
            else
            {
                return(null);
            }

            WriteData(surfSpots);

            return(surfSpot);
        }
示例#6
0
 internal SurfSpot Create()
 {
     var surfSpot = new SurfSpot() {  };
     return surfSpot;
 }